How do I extract data from the phase response in the DSP Systems Toolbox?

1 view (last 30 days)
Within MATLAB's Digital Signal Processing Toolbox, I've been able to extract spectrum data and store it as a variable using the "getSpectrumData" function. I'm trying to extract the data (values of the x and y-axis) of the phase response displayed by the Dynamic Filter Visualizer. I've provided the figure generated by the DFV for reference. Thank you.

Answers (1)

Pratyush
Pratyush on 20 Oct 2023
Hi G,
I understand that you want to extract the values of x-axis and y-axis displayed by the spectrumAnalyzer.
The "getSpectrumData" function gives you a spectrumTable object. The "FrequencyVector" field of this spectrumTable object has the x-axis data and the "Spectrum" field has the corresponding y-axis data. The following code example shows how to access the data from Dynamic filter visualizer:
% get the spectrum data
specTable = getSpectrumData(scope)
% get the phase response
phaseResponse = specTable.Spectrum{1,1};
% get the corresponding frequency
frequency = specTable.FrequencyVector{1,1};
Hope this helps!
  1 Comment
G
G on 20 Oct 2023
Edited: G on 20 Oct 2023
Hi Pratyush,
I've already been able to do this to get the spectrum and frequency vectors from a spectrum. I am trying to obtain the phase response (bottom graph in post above) of the DynamicFilterVisualizer ("dsp.DynamicFilterVisualizer" function). I apologize for the confusion. Thank you.

Sign in to comment.

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!