Setting pwelch frequency resolution
71 次查看(过去 30 天)
显示 更早的评论
Hi All, I have a time series recorded at 100Hz for which I want to use pwelch (60 sec signal). My prob is that I want to obtain the results with a specific resolution of 0.01Hz and I am struggling to set up the right inputs for the windows, nfft and overlap to achieve that. Any ideas how to do that?
Cheers
Eduardo
0 个评论
采纳的回答
Nitin Kapgate
2020-8-13
Refer to the documentation of “pwelch” function for the calculation of different parameters to be used to achieve the desired frequency resolution. If you want to learn more about how the “pwelch” function is used in a practical application, refer this example here.
The following code snippet will help you in using the “pwelch” function in your application.
% Reset the random number generator for reproducible results.
rng default
fs = 100; % Assuming the sampling frequency is 100 Hz
t = 0:1/fs:60-1/fs; % Assuming that the signal is of 60 Seconds length
x = cos(2*pi*0.01*t) + randn(size(t)); % Create a test signal in which some randomized AWGN noise
% is added to a sinusoidal signal of 0.01 Hz frequency
% Use Welch's power spectral density estimation function to estimate the PSD.
% Calculation of the input parameters for "pwelch" function to get the required frequency resolution
% Resolution Required = 0.01 Hz
resolutonReqd = 0.01;
% Calculate number of FFT points (NFFT) required for the required resolution
% fs/NFFT = resolutionReqd
NFFT = fs / resolutonReqd;
% Set window size for averaging to 200
window = 200; % This makes number of FFT averages to 6000 samples/ 200 = 30
% Set overlap to 0
overlap = 0;
% Now use pwelch with above parameters.
[pxx,f] = pwelch(x,window,overlap,NFFT,fs);
% Now plot the PSD
plot(f,10*log10(pxx))
xlabel('Frequency (Hz)')
ylabel('PSD (dB/Hz)')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parametric Spectral Estimation 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!