Matlab code to determine power spectrum without using fft
5 次查看(过去 30 天)
显示 更早的评论
can someone help to get power spectrum of a signal withou using fft
0 个评论
回答(1 个)
Star Strider
2016-2-26
The only possible way to approximate that is to use a bank of bandpass filters, something like this:
Fs = 8200; % Samping Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency
pf = linspace(20,4000,17); % Passband Frequencies
cf = pf(1:end-1)+(pf(2)-pf(1))/2; % Centre Frequencies
for k1 = 1:length(cf)
[z(k1,:),p(k1,:),k(k1)] = butter(7, [pf(k1) pf(k1+1)]/Fn);
[sos{k1},g{k1}] = zp2sos(z(k1,:),p(k1,:),k(k1));
[h(k1,:),w(k1,:)] = freqz(sos{k1},512,Fs);
end
figure(1)
plot(w([1 16],:), abs(h([1 16],:)))
grid
% axis([0 0.2 ylim])
figure(2)
freqz(sos{1})
hold on
for k1 = 2:16
freqz(sos{k1})
end
hold off
% filtfilt
You would then do the filtering in parallel to separate the signals in the different bands. A for loop would work for that, but it would of course be slow.
You may want to design your own filters. My filter design procedure is in: How to design a lowpass filter for ocean wave data in Matlab?
The filter bank of bandpass filters are from an earlier Answer for a similar Question. Make the necessary changes to work with your signal and to meet your requirements.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Signal Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!