필터 지우기
필터 지우기

fft of breath signal

조회 수: 2 (최근 30일)
Niusha
Niusha 2023년 10월 20일
답변: Image Analyst 2023년 10월 20일
I got this result from this code, but the plot should be sth like this below image, how can I make it more smooth?
phi = atan2(Q_ch, I_ch);
phi = unwrap(phi);
time_taken = length(I_ch)/Fs;
t_array = linspace(0, time_taken, length(I_ch));
Range = (c.*phi)/(4*pi*fc);
min_range = min(Range);
adjusted_range = Range - min_range;
Range = ((c.*phi)/(4*pi*fc));
figure;
plot(t_array, -adjusted_range);
title("Respiratory Rate CW");
xlabel("Time");
ylabel("Amplitude");
%fft
range_fft = abs(fft(abs(Range)));
range_fft_half = range_fft(1:length(range_fft)/2);
%DB Value
fft_db_norm = 20*log10(range_fft_half);
fft_db_norm = fft_db_norm(1:100) - max(fft_db_norm(1:100));
fft_db_norm(fft_db_norm < -60) = -60;
fft_db_norm(fft_db_norm > 0) = 0;
%Plot
f_array = linspace(0, 2, length(fft_db_norm));
figure;
plot(f_array, fft_db_norm);
title("Heart Rate (FFT)");
xlabel("Frequency (Hz)");
ylabel("Amplitude (dB)");

답변 (1개)

Image Analyst
Image Analyst 2023년 10월 20일
Looks like it has a lot more sample points, hence it can follow that curve better. Yours has fewer points so it looks choppy. See if you can sample Q_ch and I_ch at higher sampling rates to get more resolution (more elements in your vectors). Otherwise you'll just have to handle what you've got.
Give context: why do you think you need it to be smoother anyway? Maybe it doesn't need to be.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by