Zero padding in spectrogram function
11 次查看(过去 30 天)
显示 更早的评论
Hi, i am kinda new with matlab. how do i use zeropadding to test if i get better results?
after i load the data of my experiments i use the following code:
window = 512 ;
figure(2);
spectrogram(data,blackman(window),500,window, fs ,'yaxis');
xlabel('Time (sec)');
ylabel('Frequency (Hz)');
colormap jet ;
thanks for help!
回答(1 个)
Galdir Reges
2020-7-31
If you want zero padding to increase the resolution of each short time fft, you must change the nfft in syntax
spectrogram(x,window,noverlap,nfft, fs)
If X is a vector and the length of X is less than nfft, then X is padded with trailing zeros to length nfft.(https://www.mathworks.com/help/matlab/ref/fft.html)
Also, you define can use the syntax with cyclical frequencies, specified as a vector. f must have at least two elements, because otherwise the function interprets it as nfft. The units of f are specified by the sample rate, fs.
spectrogram(x,window,noverlap,f, fs)
then f specify a frequency zoom and zero padding. For example, f=[55:0.001:65], with fs in samples per second, set the spectrogram to the range between 55Hz and 65Hz also with a frequency increment of 0.001 Hz using enough zero padding to that
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time-Frequency Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!