How to plot Magnitude Response of the Savitzky Golay (SG) Filter using the FVTOOL?

2 vues (au cours des 30 derniers jours)
Varun Gupta
Varun Gupta le 8 Juil 2021
Commenté : Varun Gupta le 17 Juil 2021
I have implemented the SG filter using the following code:
y_11 = sgolayfilt(T.Temp, 2, 11)
y_21 = sgolayfilt(T.Temp, 2, 21)
y_31 = sgolayfilt(T.Temp, 2, 31)
I want to plot the Magnitude response of these filters using the FVTOOL (for varying framelenghts in one graph) , How can I do so?
I tried,
fvtool(y_11,y_21,y_31)
But this is not generating desired results.
While if I plot for individual values, then the graphs make seems to be somewhat correct ( I may be wrong) , e.g.
fvtool(y_11)
Kindly guide me with how I can correctly plot the Magnitude Response of the SG filter.
(with or without fvtool, that contains filters of different framelengths in 1 graph, so I can compare the affect of framelength)
Thank you.

Réponses (1)

Hrishikesh Borate
Hrishikesh Borate le 15 Juil 2021
Hi,
Following code demonstrates plotting y_11, y_21, y_31 in the same graph using the fvtool.
fvtool(y_11,1,y_21,1,y_31,1);
For more information, refer FVTool.
  2 commentaires
Varun Gupta
Varun Gupta le 15 Juil 2021
I'll try and get back, what do the 1 values indicate?
Varun Gupta
Varun Gupta le 17 Juil 2021
I checked, this is not generating the desired result.
fvtool(y_21,1,y_71,1)
1) only y_71 is being displayed.
2) That too, not as it should be.
The nature of the graph should be like this (even zooming in on the above graph does not yield this result)
and, still waiting for the explanation of the suggested changes.
Thank you.

Connectez-vous pour commenter.

Produits


Version

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by