fft of breath signal

2 次查看(过去 30 天)
Niusha
Niusha 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