How can i obtain the frequency response for Savitzky-Golay filtering?
    5 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    mayur khedekar
 il 27 Nov 2019
  
    
    
    
    
    Commentato: Star Strider
      
      
 il 8 Lug 2021
            I want to prove that this filter is a low pass filter by passing it from a heaviside and then i need the define the transfer function to get the bode plots.
How should i get the transfer function for heavyside.
0 Commenti
Risposta accettata
  Star Strider
      
      
 il 27 Nov 2019
        Try this instead: 
t = linspace(0, 10);
y = sin(2*pi*t/5) + randn(size(t))/10;
sgf = sgolayfilt(y, 3, 11);
figure
plot(t, y)
hold on
plot(t, sgf, '-r')
hold off
grid
L = numel(t);
Ts = mean(diff(t));
Fs = 1/Ts;
Fn = Fs/2;
FTy = fft(y)/L;
FTsgf = fft(sgf)/L;
Fv = linspace(0, 1, fix(L/2)+1)*Fn;
Iv = 1:numel(Fv);
figure
subplot(3,1,1)
plot(Fv, abs(FTy(Iv))*2)
grid
title('Fourier Transform: y')
subplot(3,1,2)
plot(Fv, abs(FTsgf(Iv))*2)
grid
title('Fourier Transform: Savitzky-Golay Filter of y')
subplot(3,1,3)
plot(Fv, abs(FTsgf(Iv)./FTy(Iv))*2)
grid
title('Savitzky-Golay Transfer Function')
This nicely demonstratres the lowpass filter characteristic.  
Experiment with other signals to get different (but likely similar) resultls.  
6 Commenti
  Varun Gupta
 il 8 Lug 2021
				I ran the signalVisualizer tool ---> (views) Spectrum, and feel much closer to what I wanted to see,
Its a graph against Power Spectrum (dB) and normalized frequency, I see that the graph is quite similar to how the frequency response of the SG filter should look like. 
Are they idicating the same thing?
Thank you so much for the help.
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Digital Filter Analysis in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!