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

3 views (last 30 days)
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');

Answers (1)

Image Analyst
Image Analyst on 23 Jul 2017
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 Comment
Farrukh Karimov
Farrukh Karimov on 23 Jul 2017
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!

Sign in to comment.

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!