Time domain to Frequncy domain signal conversion
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
This is my program to generate time-amplitde ECG signal, now i want to convert this output signal into frequency-amplitude domain. I tried using FFT technique but it is invalid taking fft(x,y). Please Help
A=dlmread('samples (7).csv',',',2,0);
x= A(2:1:14761 ,1);
y= A(2:1:14761 ,2);
figure;
%z=f(x,y);
hold on;
z=plot(x,y);
xlabel('Time(sec)')
ylabel('Amplitude(mV)')
axis tight;
grid on;
0 comentarios
Respuestas (1)
Star Strider
el 27 de Feb. de 2019
2 comentarios
Star Strider
el 27 de Feb. de 2019
Try this:
filename = 'samples (7).csv';
[D,S] = xlsread(filename);
t = D(:,1);
EKG = D(:,2);
figure
plot(t, EKG)
grid
L = numel(t); % Data Row Size
QF = std(diff(t)); % Check For Non-Uniform Sampling
tr = linspace(min(t), max(t), L); % Time Vector For Resampling
EKGr = resample(EKG, tr); % Resampled EKG
Ts = mean(diff(t)); % Sampling Interval (s)
Fs = 1/Ts; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency (Hz)
FT_EKG = fft(EKGr-mean(EKGr))/L; % Fourier Transform (Offset Corrected)
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
plot(tr(1:500), EKGr(1:500))
grid
figure
plot(Fv, abs(FT_EKG(Iv)))
grid
xlim([0 50])
xlabel('Frequency (Hz)')
ylabel('Amplitude (mV)')
Ver también
Categorías
Más información sobre Spectral Measurements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!