Zero padding in spectrogram function
9 ビュー (過去 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!