Can any one please help me with the following code?

%this script puts together plot data showing the upsweep IF vs. range for
%stationary targets when using a 200, 800, and 1200 MHz bandwidth, while
%keeping the chirp time at a constant 1.024 ms.
close all;
clear all;
clc;
rmax = 300; %max range to plot
c = 299704764; %speed of light in m/s
f0 = 77e9;
tchirp = 1.024 * 10^(-3); %chirp time in seconds
bandwidth = [200 800 1400 2000].* 10^6; %sweep bandwidth in Hz
k = bandwidth ./ tchirp; %sweep rate
r = 0:1:rmax; %range in metres
IF = 2*k'*r/c;
v = (c * IF)/ (2 * f0);
csvwrite('test.csv', [r' IF' v']);
figure (1);
hold on;
plot(IF')
xlabel ('range/m')
ylabel ('IF/Hz')
grid on
figure (2);
hold on;
plot(IF', v')
xlabel ('IF/Hz')
ylabel ('velocity m/s')
grid on
Here IF is calculated for a series of values for r.
How can I do the opposite, Calculate the value of r for the series of values of IF. And what does the k' mean....? I mean the ' symbol after k?

1 Comment

The ' operator is Conjugate Transpose. The effect in this code is going to be to take the row vector value of k and use it as a column vector instead.

Sign in to comment.

Answers (2)

As Walter mentioned, ' operator is conjugate transpose. As to this case, because k is real, it is simply transpose to make it a column vector.
You have the equation in your code,
IF = 2*k'*r/c
so to get r from IF, you can do
r = IF(1,:)*c/(2*k(1))
I tried but it is showing this error...
??? Error using ==> mrdivide Matrix dimensions must agree.
here is the code that I tried...
%this script puts together plot data showing the upsweep IF vs. range for %stationary targets when using a 200, 800, and 1200 MHz bandwidth, while %keeping the chirp time at a constant 1.024 ms.
close all; clear all; clc; rmax = 300; %max range to plot c = 299704764; %speed of light in m/s f0 = 77e9; tchirp = 1.024 * 10^(-3); %chirp time in seconds
bandwidth = [200 800 1400 2000].* 10^6; %sweep bandwidth in Hz
k = bandwidth ./ tchirp; %sweep rate
IF = 60:20:rmax; %range in metres
r = IF*c/(2*k) v = (c * IF)/ (2 * f0); csvwrite('test.csv', [r' IF' v']); figure (1); hold on; plot(IF') xlabel ('range/m') ylabel ('IF/Hz') grid on figure (2); hold on; plot(IF', v') xlabel ('IF/Hz') ylabel ('velocity m/s') grid on

2 Comments

I updated the previous answer, sorry I was writing an equation more than writing the code. I think I understand why the original code use k' now, it is simply trying to get IF for all the combination of k and r. Since r is the same for each k, when converting back, you only need one slice of IF.

Sign in to comment.

Asked:

on 9 Jul 2012

Community Treasure Hunt

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

Start Hunting!