How to plot average (mean) signal of 231 signals and plot the frequency response of that mean signal?

3 次查看(过去 30 天)
Hi all, I would like to plot an average signal of 231 signals in time domain and plot the frequency response graph. Here is my code and I would appreciate if somebody gives me any idea how to solve it.
signal = a; % acceleration
time=vt; % time
% Plot Original signal in Time Domain
subplot(211);
plot(vt,a(:,1:231,1)); % for sensor 1
title('Multiple signal in Time Domain(Healthy-Sensor1)');
xlabel('Time [s]');
ylabel('Acceleration [m/s^2]');
%FFT plot
Fs=32768; %Sampling frequency
N=2048;
y = fft(a(:,1:231,1),N)/length(signal);
Fn = Fs/2;
Fv = linspace(0, 1, fix(length(y)/2)+1)*Fn;
Iv = 1:length(Fv);
subplot(212);
plot(Fv,abs(y(Iv))*2);
title('FFT(Healthy-Sensor1)');
xlabel('Frequency [Hertz]');
ylabel('Magnitude');

回答(1 个)

Image Analyst
Image Analyst 2017-7-23
I don't think you can use fft like this:
y = fft(a(:,1:231,1),N)/length(signal);
fft() is for 1-D signals, not 2-D signals or 3-D signals which is what a(:,1:231,1) is. I think you have to call mean() on one direction of the a signal, then fft that one 1-D mean signal. Please attach a and vt in a .mat file if you want more help.
  1 个评论
Farrukh Karimov
Farrukh Karimov 2017-7-23
Thank you for your help. However, the file size is more than 5mb, so here is a link on google drive
https://drive.google.com/file/d/0B7GxFIsnZHu4Z0lKT2V1b2ZKbGM/view?usp=sharing Thank you again!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by