フィルターのクリア

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 Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by