Filter löschen
Filter löschen

fft of breath signal

2 Ansichten (letzte 30 Tage)
Niusha
Niusha am 20 Okt. 2023
Beantwortet: Image Analyst am 20 Okt. 2023
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)");

Antworten (1)

Image Analyst
Image Analyst am 20 Okt. 2023
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.

Kategorien

Mehr zu Downloads finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by