how get the range from FFT on FMCW radar data

The data from an FMCW radar is 256x128, so I got 256 samples of every of the 128 ramps. There is only one target being scanned.
Now I would just use fft(), calculate the magnitude and then find the index peak. But when I know where the peak is, which Im not too sure how to do as well, how do I use that index to then calculate the range and also the velocity of the target with matlab code?

2 Comments

HI @Simeon, were you able to solve the problem. I am trying to perform the same fft analysis on FMCW radar data which is for each radar frame, its raw data (*.mat) has 4 dimension: samples (128), chirps (255), receivers (4), transmitters (2).
Please let me know if you were able to perform fft analysis.
Simeon
Simeon on 15 Feb 2024
Edited: Simeon on 15 Feb 2024
Unfortunately not, I just submitted my best attempt but looking at the resulting data, it wasn't correct at all

Sign in to comment.

Answers (3)

You need to specify exactly what the signal that you have consists of. It could be the received signal mixed with a reference signal with a constant frequency. YOu say it is 256 by 128, representing 128 ramps. It this is a time domain signal, then can we think of it as one continuous signal with diraiton 256x128 (a vector instead of an array)? The reaon I am asking is that if you have a time domain signal, you will want to do a time-dependent =Fourier transform, using Matlab's stft(). But if the signal has already been frequency-analyzed, then what you have is frequency versus time, already.
To get range and velocity, your "ramp" signal should be a triangle, not a sawtooth. YOu said you have 128 ramps. Does that mean 64 up-ramps and 64 down-ramps, each of which is 256 points long? Or 128 round-trip ramps, where the up is 128 points long and the down is 128 points long? IT affects the signal processing.
YOu also need the transmitted signal for reference.
It will help if you post the signal you have. Innclude the transmitted signal too if you have it.

4 Comments

The entire duration of a ramp is sampled. The data sets have three dimensions. In the first dimension, meaning the column vectors, are the sampled values of a ramp. The second dimension, meaning the row vectors, indicates the number of the ramp. The third dimension indicates the antenna.
For example, if you want to get the sampled baseband signal of the 10th ramp of the 2nd antenna, you would obtain this with: adcData(:, 10, 2)
The assignment says:
Load the dataset as follows:
data = load('Task3');
adcData = data.adcData_Task_3;
a.) Define the variables from Table 1 and additionally NSamples with the number of samples per ramp.
b.) Plot the baseband signal of the 1st ramp in the interval t = [0, TRamp - 1/FSample] for both Antenna 1 and Antenna 2. For this, first set up a time vector t. Label the axes and give the graph a title.
c.) Form the spectrum of each ramp for both antennas. Save this in the variable FFTR. For this, set up a frequency vector Fr. From this, calculate the distance vector R.
Note: Do not forget the fftshift command!
...a couple of tasks...
g.) Now perform an FFT on FFTR across the ramps (i.e., on the row vectors). Save this in the variable FFTV. This will give you the Doppler frequencies for the respective distances. Also define an appropriate frequency vector FD for this. From this, calculate the radial velocity vector V.
Task c.) is the one I'm having problems with, especially with calculating this distance vector, but also g.) and the velocity vector.
Except for some variable declarations and a diagram of the structure of the underlying FMCW radar, thats all the information I got for solving these tasks.
Since you have not provided the data or Table 1, it is hard to say.
The vertical axis in the plot you provied is "f_s(t)". In other words, the plot shows frequency on the vertical axis. Is the data in your 3D array also frequency as a function of time? And when you plot the data in your 3D array, does it look like a bunch of ramps? Or a bunch of chirps? The answer tells us if a time-dependent Fourier transform has already been done. As for part c, I don;t know if the teacher wants you to compute a time-dependent FT of a chirp signal, or a standard FFT of a ramp (which seems weird to me, since the ramp itself is the result of a time-dependent FT calculation, or something analogous). I would go back to my teacher and my notes to make sure I really understand the rationale for why these calculations will yield the desired results.
Simeon
Simeon on 12 Feb 2024
Edited: Simeon on 12 Feb 2024
Appreciate you following up, the raw data 'adcData_Aufgabe_3' consists of doubles / real numbers with the dimension 256x128x2, so 256 samples, 128 ramps and 2 antennas in total, which is too extensive to print out entirely. Displaying the first ten time-domain samples of the first ramp gave me: 3.0000 -0.8747 -0.7465 0.6057 -2.3439 1.6792 1.5421 -1.5130 1.1461 -1.6557. After I apply an fft / execute this code part:
N_Samples_per_Ramp = size(adcData, 1);
FFTR = fft(adcData, [], 1);
FFTR = fftshift(FFTR, 1);
disp(FFTR(1:10, 1, 1));
I get, first ten now frequency-domain samples of ramp 1:
-0.8644 + 0.0000i
-0.8652 + 0.0063i
-0.8677 + 0.0127i
-0.8720 + 0.0191i
-0.8780 + 0.0257i
-0.8858 + 0.0323i
-0.8955 + 0.0391i
-0.9073 + 0.0462i
-0.9212 + 0.0534i
-0.9374 + 0.0610i
Increasing as a frequency ramp should, that looks fine to me.
But now my attempt of extracting the range from that does not give me promising results:
% Calculate the magnitude of the FFT result
magnitude = abs(FFTR);
% Find the index of the peak
[maxValue, maxRangeIndex] = max(magnitude);
df = F_Sample / N_Samples_per_Ramp;
Fr = (-N_Samples_per_Ramp/2:N_Samples_per_Ramp/2-1) * df;
f_beat = Fr(maxRangeIndex);
R = (f_beat * c) / (2 * B);
PS: deadline for the assignment is tonight :)
@Simeon, sorry I cannot help you in the time available. In the future, you can attach a data file yto your quesiton by clicking on ther the paper clip symbol which is part of the "Insert" set of options.

Sign in to comment.

You may want to look at the following example, especially the "Range and Doppler Estimation" section. It shows how to extract the frequency component and convert it to range.
HTH
hi! did you manage to find the range using FFT, i'm trying to do something similar and I'd really appriciate some help:)

Products

Release

R2023a

Asked:

on 11 Feb 2024

Answered:

Adi
on 21 Nov 2024

Community Treasure Hunt

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

Start Hunting!