Clear Filters
Clear Filters

I have a problem Problem understanding SPTool

1 view (last 30 days)
I have two questions about use of the Spectrum Viewer:
1. The displayed frequency in the Spectrum viewer window [0,fs/2] gives me an apparent range from 0 to 256 Hz when I use a sampling rate of 512 Hz. But I am only interested in the frequency range from 0 to 50 Hz. Do not see how to manage that x-axis range.
That leads me to want to Export data that goes into the spectrum.
2. When I Export Spect2[auto] to the workspace I get two variables that appear to contain spectral data: contained in the Spect2 structure are arrays for p and f. I can't fined any array that looks like the PSD seen on the Spectrum Viewer. Also: how can In interpret what I get from a plot of the arrant p in the workspace?
Helpful comments will be GREATLY appreciated.
Many thanks in advance
Don

Accepted Answer

Wayne King
Wayne King on 4 Jul 2012
Hi Don, Yes by default it gives you the spectrum from 0 to Fs/2 (the Nyquist frequency). You can use Mouse Zoom (under Options) to zoom in on the interval from 0 to 50 Hz if you wish.
The structure array that is exported to the workspace contains all the information you need. The reason it looks different is that it gives you the power spectrum from -Nyquist to Nyquist. If you just plot
plot(f,10*log10(P))
For the range of frequencies from 0 to Nyquist, you'll get the exact result.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!