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
Walter Roberson
2012년 7월 9일
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.
답변 (2개)
Honglei Chen
2012년 7월 9일
편집: Honglei Chen
2012년 7월 9일
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))
Ahmed
2012년 7월 9일
0 개 추천
댓글 수: 2
Walter Roberson
2012년 7월 9일
Try .* and ./
Honglei Chen
2012년 7월 9일
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.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!