I have this data set which is recorded from 50 children with FMCW radar to detect their heart rate and respiration rate. I am using this data set and I want to just calculate the range FFT and after that applying Doppler FFT in one of the receivers of it. The size of raw data is 4 ** 512 ** 6,000, where 4 is the number of receivers, 512 is the number of samples of each frame and 6,000 (60 * 5 minutes * 20 frames per second) is the number of all the frames.
I have the following code but the Doppler_fft of all the windows gives me the same peak and it seems that the heart is not moving at all. I have used the 30 second windows (which includes 600 frames of 1,200 chirps) and I’m sliding the window in each loop. According to the Range_FFT plot the maximum peak of range_fft is in the 37th sample so the Doppler_FFT_goal shows the doppler fft of the exact location of the target.
close all
clear
clc
%% Select Participant Number ( 1 - 50 )
ParticipantNum = 1;
if ( ParticipantNum < 1 || ParticipantNum > 50 )
disp('Wrong Participant Number')
return;
end
%% Set Parameters
para = f_Parameter();
%% Read CSV Data
% read radar rawdata
fid = fopen(['RawdataFMCW RadarRawdataRawdata_' num2str(ParticipantNum) '.csv']);
tstream = textscan(fid, '%d', 'Delimiter', ',');
tstream = tstream{1,1};
streamsize = size(tstream,1)/para.AntNum;
Rawdata = zeros(para.AntNum, streamsize);
for i = 1:para.AntNum
Rawdata(i,:) = tstream((i-1)*streamsize+1:i*streamsize);
end
fclose(fid);
refBRFilePath = ['C:mydataNihon KohdenHeart Rate & Breathing RateRef_Breath_' num2str(ParticipantNum) '.csv'];
refHRFilePath = ['C:mydataNihon KohdenHeart Rate & Breathing RateRef_Heart_' num2str(ParticipantNum) '.csv'];
Ref_BR = csvread(refBRFilePath);
Ref_HR = csvread(refHRFilePath);
%% Reshape Radar RawData to Signal Processing
RawData = reshape(Rawdata, para.AntNum, para.adcsample*para.chirploops, para.datalength);
%% plot the first frame of the first RX antena
t = 3.3333e-07:512/3000000/512: 512/3000000 *(20*60*5) ;
figure(1)
plot(t(1:512),abs(reshape(RawData(1,:,1),1,512)))
hold on
plot(t(1:512),imag(reshape(RawData(1,:,1),1,512)))
title("the IF signal of the first frame and RX antena")
legend("real part","imaginary part")
ylabel("amplitude")
xlabel("time")
%% calculations of range
% fft(exp(j*w0*t)) ==> 2*pi*delta(w-w0) ==> w0=2*pi*BW*tdelay / Tchirp
% tdelay= w0* Tchirp / 2*pi*BW ==> tdelay = 2*distance / c
% distance = w0 *Tchirp *c / 4* pi*BW
%w0=2*pi*fbeat ==> distance(range) = fb*Tchirp*c / 2*BW
%% range fft
Mix= reshape(squeeze(RawData(1,:,:)),256,12000);
N= 1024;
Range_FFT = zeros(N,12000);
for i=1:12000
Range_FFT (:,i) = fft(Mix(:,i),N);
end
Fs =para.samplerate;
% Range_FFT = fft(Mix(:,1),N),1;
%freq = linspace(0, para.fps/2, length(Range_FFT(1:N/2,1)));
freq = (0:(N-1)/2)*(Fs/N);
Range = (freq *para.c)/(2*para.freqslope);
figure('Name',"one sided range fft of one chirp 1-20 vs range")
plot(Range,abs(Range_FFT(1:N/2,1)));
% doppler fft with 30 seconds windows
Doppler_FFT_goal =zeros(12000-1201,1200);
Doppler_FFT_useless =zeros(12000-1201,1200);
for i=1:12000-1200
Doppler_FFT_goal(i,:)=fftshift(fft(Range_FFT(38,i:i+1199),[],2));
Doppler_FFT_useless(i,:)=fftshift(fft(Range_FFT(100,i:i+1199),[],2));
end
freq_doppler = (1:1200)*(Fs/1200);
velocity = para.lambda*(abs(freq_doppler))/ 2*pi*(2*para.tc) ; % v= (lambda*f) / 4*pi*Tc
figure(5)
plot(velocity,abs(Doppler_FFT_goal(1,:)));
hold on
xlabel("velocity (m/s)");
ylabel("the doppler FFT 0f chirps");
plot(velocity,abs(Doppler_FFT_goal(2,:)));
legend("the first 30 seconds","the second 30 seconds")
Fatemeh Masoumi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.