Can I adjust the waveform axis?

MATLAB documentation examples for the spectrogram function are examples where the frequency axis is set to [0 500] . Can I change this to something like [0 100] ? Obviously, executing the axis command will do this for me, but it will adjust the final result and β€œblow up” the result, make it pixelated. I am basically looking to build a spectrogram that only searches for frequencies between 0-100, and not scaling after building the spectrogram.

Here is an example from this documentation:

 T = 0:0.001:2; X = chirp(T,0,1,150); spectrogram(X,256,250,256,1E3,'yaxis'); 

This gives the following: Linear chirp spectrogram

Anything below 350 Hz is not used. Is there a way not to include everything from 350 to 500 when building a spectrogram, and not adjust the axis after the fact?

+4
source share
2 answers

From the documentation:

[S, F, T] = spectrogram (x, window, noverlap, F) uses the frequency vector F in Hz. F must be a vector with at least two elements. This case computes the spectrogram at frequencies in F using the Goertzel algorithm. The indicated frequencies are rounded to the nearest DFT tray, commensurate with the signal resolution. In all other syntax cases where nfft is used or the default value for nfft, the short-term Fourier transform is used. The returned vector F is a vector of rounded frequencies. T is the time vector during which the spectrogram is calculated. The length F is equal to the number of rows S. The length T is k, as defined above, and each value corresponds to the center of each segment.

Does this help you?

+6
source

The FFT is so fast that it’s better to increase the resolution and then simply discard the unwanted data. If you need better spectral resolution (more boxes with frequencies), increase the FFT size. To get a smoother spectrum over time, increase the noverlap value to reduce the increments for each conspiratorial FFT. In this case, you would not specify F. If the FFT size is 1024, you get 1024/2 + 1 frequency cells.

 FFTN = 512; start = 512*(350/500); % Only care about freq bins above this value WIN_SIZE = FFTN; overlap = floor(FFTN*0.8); [~,F,T,P] = spectrogram(y, WIN_SIZE, overlap, FFTN); f = 0:(length(F)-1); f = f*((Fs/2)/length(F)); P = P(start:512,:); f = f(1,start:512); imagesc(T,f,10*log10(P),[-70 20]); 
-1
source

Source: https://habr.com/ru/post/1438759/


All Articles