필터 지우기
필터 지우기

Time domain to Frequncy domain signal conversion

조회 수: 3 (최근 30일)
vandana sharma
vandana sharma 2019년 2월 27일
댓글: Star Strider 2019년 2월 27일
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;

답변 (1개)

Star Strider
Star Strider 2019년 2월 27일
Use the Signal Processing Toolbox spectrogram (link) function to do time-frequency analysis.
  댓글 수: 2
vandana sharma
vandana sharma 2019년 2월 27일
i do not want to do the time-frequency analysis, i want to convert/plot the same time-ampltude domain signal into frequency-amplitude domain.
Star Strider
Star Strider 2019년 2월 27일
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)')

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

카테고리

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