필터 지우기
필터 지우기

How to calculate the spectrum of a signal in CSV file?

조회 수: 10 (최근 30일)
Florentino Ruiz
Florentino Ruiz 2011년 3월 17일
I'm working on a project whose aim is to develop measurements of acceleration with an accelerometer, I have made ??measurements 10.24kS sampled, stored in CSV files, measurements were performed for two seconds, which means I have 20.48 kS. I need to convert the acceleration signal to a new speed signal using integration. Then I apply the FFT to acquire the spectrum of the speed signal with a Hanning or Hamming window. But I do not know how to do any of these steps. If anyone has any idea how to do it, I appreciate your help.
  댓글 수: 2
vsee
vsee 2011년 4월 7일
Hello
I have a similiar situation. I have a signal stored in a csv file. The sample interval is 2us which means a sample taken every 2 micro seconds. I have a million sampples in the file. Essentially the signal is in the time domain (x(t) vs t). I have to acquire the spectrum of the signal to analyze it. Can you please explain how to do this?
Walter Roberson
Walter Roberson 2011년 4월 7일
vsee, please start a new Question for your topic.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2011년 3월 17일
csvread(), trapz(), fft()
  댓글 수: 1
Florentino Ruiz
Florentino Ruiz 2011년 3월 17일
Thank you for your answer, now i have idea for my proyect.
close all
clear all
clc
Fs = 10240; % Sampling frequency
T = 1/Fs; % Sample time
L = 20480; % Length of signal
t = (0:L-1)*T; % Time vector
load axmacovel
figure (1)
plot(t,axmacovel(1:L))
% plot(Fs*t(1:L),axmacovel(1:L))
title('Velocidad de vibración')
xlabel('Tiempo (s)'), ylabel('Velocidad mm/s RMS'), grid on
% NFFT=2^nextpow2(L); % Siguiente pot de 2 de la long de 'y'.
Y=fft(axmacovel); % Aplica Transformada de Fourier.
% f=Fs/2*linspace(0,1,NFFT/2); % Vector de frecuencias.
f=Fs/2*linspace(0,1,L/2);
figure (2)
% plot(f,2*abs(Y(1:NFFT/2))),
plot(f,0.707*abs(Y(1:L/2)))
title('Espector de la Señal'),
xlabel('Frecuencia (Hz)'), ylabel('Velocidad mm/s RMS'), grid on
axmacovel is on my workspace of matlab, this variable was adquired manually: File-Import Data, etc. This axmacovel signal is the integration of the original acceleration signal, but i will have this manually. I don´t know if i used fft function correctly, because the level of signal in espectrum are different as i have in a Labview program.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by