Graphics Programs Reference
In-Depth Information
5.5. MATLAB Program and Function Listings
This section presents listings for all MATLAB programs/functions used in
this chapter. The user is strongly advised to rerun the MATLAB programs in
order to enhance his understanding of this chapterÓs material.
Listing 5.1. MATLAB Program Ðfig5_3.mÑ
% use this program to reproduce Fig. 5.3 of text
clear all
close all
nscat = 2; %two point scatterers
taup = 10e-6; % 10 microsecond uncompressed pulse
b = 50.0e6; % 50 MHz bandwidth
rrec = 50 ; % 50 meter processing window
scat_range = [15 25] ; % scatterers are 15 and 25 meters into window
scat_rcs = [1 2]; % RCS 1 m^2 and 2m^2
winid = 0; %no window used
[y] = matched_filter(nscat,taup,b,rrec,scat_range,scat_rcs,winid);
Listing 5.2. MATLAB Function Ðmatched_filter.mÑ
function [y] = matched_filter(nscat,taup,b,rrec,scat_range,scat_rcs,winid)
eps = 1.0e-16;
% time bandwidth product
time_B_product = b * taup;
if(time_B_product < 5 )
fprintf('********** Time Bandwidth product is TOO SMALL *********')
fprintf('\n Change b and or taup')
return
end
% speed of light
c = 3.e8;
% number of samples
n = fix(5 * taup * b)
% initialize input, output and replica vectors
x(nscat,1:n) = 0.;
y(1:n) = 0.;
replica(1:n) = 0.;
% determine proper window
if( winid == 0.)
win(1:n) = 1.;
win =win';
else
if(winid == 1.)
Search WWH ::




Custom Search