⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demosmoothredraw.m

📁 Interactive smoothing for time-series signals, with sliders that allow you to adjust the smoothing
💻 M
字号:
% Redraws graph for DemoSmoothSlider when the sliders are changedglobal t
global SmoothSignal
global signal
global Noise
global NoiseArray
global puresignal
global wid
global SmoothWidth
global Passes
  axes(h);
  PlotRange=[SmoothWidth.*1:length(t)-SmoothWidth.*1];
  
 % Smooth the simulated signal with noise
  temp=signal;
  for k=1:Passes,
      % You can use any smooth function here in place of fastsmooth
      temp=fastsmooth(temp, SmoothWidth);
  end
  SmoothSignal=temp;
  
 % Smooth the noise
  temp=NoiseArray;
  for k=1:Passes,
      % You can use any smooth function here in place of fastsmooth
      temp=fastsmooth(temp, SmoothWidth);
  end
  SmoothNoise=temp;
  
 % Smooth the pure noiseless signal
  temp=puresignal;
  for k=1:Passes,
      % You can use any smooth function here in place of fastsmooth
      temp=fastsmooth(temp, SmoothWidth);
  end
  PureSmoothSignal=temp;
  % Compute the SNR
  Signal=range(PureSmoothSignal(PlotRange));
  SNR=Signal./std(SmoothNoise(PlotRange));  
  % Plot the smoothed signal
  h=figure(1);
  plot(t(PlotRange),SmoothSignal(PlotRange))
  % Compute the peak parameters of the smoothed peak
  [PeakX, PeakY, Width]=PeakEst(t,SmoothSignal,length(t)./2,wid/2);
  figure(1);title(['Smooth Width = ' num2str(SmoothWidth) '     Smooth Ratio = ' num2str(SmoothWidth./wid) '     Passes = ' num2str(Passes) ])
  xlabel(['Signal maximum = ' num2str(max(SmoothSignal))  '     Peak Width = ' num2str(Width) '     SNR = ' num2str(SNR) ]);
  h2=gca;
  axis([0 length(t) -.10 1]);
  grid on

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -