I am implementing a signal processing algorithm to determine tremor and non tremor activity in a signal. The tremors of interest are in the range of 4-8Hz and I need to find the max value for each window but i am only getting one plot and when i use a for loop with a window the same pwelch signal outputs like 6 times. Here is my code:
wind = 2; ws = wind * samp_freq; trem_feat = (filt_trem); for i = 1:ws:L-ws window = i : i+ws; [pxx, f] = pwelch(trem_feat ,500 ,300 ,500 ,samp_freq); figure; plot(f, 10*log10(pxx)); title('PSD'); xlabel('Frequency (Hz)'); ylabel('PSD (dB/Hz)'); end
How do i get the average pwelch of all windows?