0% found this document useful (0 votes)
61 views

Final Report Scanning Digital Radar

This document summarizes a scanning digital radar receiver final report. It describes the design of the receiver front end and the software algorithms used to determine signal characteristics from received pulse radar signals. Key subsystems included a mixer, data acquisition system, frequency synthesizer, and signal processing and control subsystem. The signal processing used DSP techniques like taking the FFT of the received signal to determine characteristics like pulse width, pulse repetition rate, and radio frequency. Detection algorithms were also described to identify valid pulse radar signals before full processing. Mathematical relationships were derived between time and frequency domain representations of pulsed radar signals.

Uploaded by

Prathap Singh
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

Final Report Scanning Digital Radar

This document summarizes a scanning digital radar receiver final report. It describes the design of the receiver front end and the software algorithms used to determine signal characteristics from received pulse radar signals. Key subsystems included a mixer, data acquisition system, frequency synthesizer, and signal processing and control subsystem. The signal processing used DSP techniques like taking the FFT of the received signal to determine characteristics like pulse width, pulse repetition rate, and radio frequency. Detection algorithms were also described to identify valid pulse radar signals before full processing. Mathematical relationships were derived between time and frequency domain representations of pulsed radar signals.

Uploaded by

Prathap Singh
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Scanning Digital Radar Receiver Final Report by

Ryan Hamor

Project Advisor: Dr. Brian Huggins

Bradley University Department of Electrical and Computer Engineering May 8, 2006

Table of Contents Abstract . 3 Function Description and System Block Diagram 4-9 Functional Description Mixer Subsystem .. Data Acquisition Subsystem .. Frequency Synthesizer Subsystem .. DDS Theory of Operation 4-5 5 5-6 6 6-7

Signal Processing & Control Subsystem 7-9 DSP Flow Chart Signal Detection 8 9

Mathematical Verification .. 10-11 Design of IF Filter and Amplifier 12-13 Simulation Results 13-14 Experimental Results ... 15-16 Analysis . 16-17 Conclusion 17 Datasheet .. 18

Related Standards and Patents 19 References . 20 Appendix A 21-26 Appendix B 27

Abstract An important aspect of Electronic Warfare is the development of Radar Warning Receivers (RWR). With the EM spectrum being extremely volatile in a combat situation, the RWR allows for classification and identification of enemy radar signals. Once these signals have been identified they can be used to indicate possible threats, and as a precursor to jamming devices. The Scanning Digital Radar Receiver is a scaled down version of a RWR. It identifies Pulse Radar signals and determines there characteristics. This paper describes the receiver front end design, as well as the software algorithms used to determine signal characteristics.

I. Introduction The Scanning Digital Radar Receiver is a project supported by Northrop Grumman Corporation. The function of the system is to detect a pulsed radar signal over a large frequency and power range. The frequency range is from 50 to 120 MHz and the power level can be as low as -20 dBm. After a pulsed radar signal has been identified, the system will output the characteristics of the signal to the user. II. High Level Block Diagram The high level system block diagram is shown in figure 1. The user input is strictly a software input, through this input the LO scan range can be set. The pulse radar signal is mixed with the very stable frequency synthesizer, which acts like a local oscillator. The internal signal, denoted as IF, is the down converted pulse radar signal. It is fed into the A/D board which is connected to the PC. The signal is then processed using DSP methods, and if a radar signal is present the signals characteristics are sent as outputs.

(Figure 1 High Level System Block Diagram)

The illustration of a pulse radar signal is shown in Figure 2. By processing the signal in the frequency domain, the system can determine time domain characteristics. The following is the list of outputs and how they relate to Figure 2: The Pulse Width (PW) corresponds to . The Pulse Repetition Rate (PRR) is the inverse of the period, T, of the time domain signal. The Freq RF is the frequency of the sinusoid under the pulse envelope denoted as FRF

(Figure 2 Time Domain Representation of the Pulsed Radar Signal) III. High Level Block Diagram Subsystems Mixer Figure 3 is the mixer subsystem. The mixer multiplies the RF signal with LO signal and then outputs the IF signal. The intermediate signal contains frequencies FRF-FLO and FRF+FLO, where FRF was previously defined and FLO is the frequency of the LO signal. The purpose of this subsystem is to frequency translate the RF signal to a lower frequency so that it can be sampled by the data acquisition subsystem. During the conversion process there is an average power loss of 5.24 dB. The frequency of the LO signal is limited to 120 MHz to prevent aliasing. This limit is also set on the frequency of the RF signal.

(Figure 3 Mixer Subsystem)

Data Acquisition Figure 4 shows the Data Acquisition subsystem. It is composed of an analog filter, amplifier, and the data acquisition board. The IF signal is filtered using a low-pass filter with a 200 KHz cutoff, which passes the FIF frequencies with little attenuation, but significantly attenuates signals with frequencies above 200 KHz. After filtering, the signal is amplified using a 741 op-amp in a non-inverting configuration. The amplifier adds about 20 dB of gain to compensate for the losses due to the filter. The amplifier is also used to set the voltage scale of the IF signal for the best data acquisition. The data acquisition card is the I/O tech 3005USB; it has a maximum sampling rate of 1MS/sec and 16 bit resolution. The 1 MHz sampling rate applies for only one channel. While the card has 16 channel, every additional channel in use cuts the sampling rate by two. In addition to the analog inputs, the 3005 USB contains 32-bit counters and times for automated sampling.

(Figure 4 Data Acquisition Subsystem) Frequency Synthesizer Figure 5 shows the Frequency Synthesizer subsystem. The control word is sent to the frequency synthesizer, through the parallel port, which determines the frequency of the synthesizer output. To boost power to the mixer a 10 dB amplifier is used. The amplifier is needed to get the amplitude from the DDS frequency synthesizer up to the 7 dBm level needed for the mixer. The Analog Digital DDS 9854 is used as the frequency synthesizer. It uses direct digital synthesis to create a very stable sinusoid wave form. The maximum frequency of the synthesizer is 120 MHz to prevent aliasing.

(Figure 5 Frequency Synthesizer Subsystem)

DDS Theory of Operation DDS or Direct Digital Synthesis is the ability to use a digital system to create an analog output. Figure 6 is a block diagram of the core of a generic DDS system. The frequency tuning word is loaded into the Phase Accumulator. The values in the Phase Accumulator correspond to output points on the cycle of the output sinewave. Resolution of the Phase Accumulator is determined by N and can range from 24 to 48 bits. The Phase Accumulator functions as a counter and every pulse from the reference clock increase the count value. By increasing the frequency tuning word the counter takes bigger steps and the sinewave cycle is completed faster, thus increasing the output frequency.

(Figure 6 Block Diagram of DDS Core) The output of the phase accumulator is linear and cannot directly be used to generate a sinewave or any other waveform except a ramp. Therefore, a phase-to-amplitude lookup table is used to convert a truncated version of the phase accumulators instantaneous output value into the sinewave amplitude information that is presented to the D/A converter. Signal Processing & Control Subsystem Figure 7 shows the components contained in the signal processing and control block. Visual Basic is used to communicate with the frequency synthesizer, configure the system, and display results. A server version of Matlab is used to process the radar signal. Through a COM interface Visual Basic can run m-files, as well as extract results from the Matlab server.

(Figure 7 Signal Processing and Control Block Diagram) 7

DSP Flow Chart Figure 8 shows how the radar signal is processed in Matlab. The signal processing begins by checking if a signal was detected. If no signal is detected the frequency synthesizer is incremented and the program exits. However, if a signal is detected, then its FFT is taken. The FFT consists of an array whose points correspond to various magnitudes. To get frequency information, a frequency array is constructed based on the number of points in the FFT and the sampling rate. To find the IF frequency the point with the maximum magnitude is found in the FFT array and is correlated with the same point in the frequency array. To get the PRR the point with the next largest magnitude is found. The frequency of that point is subtracted from the IF frequency to get the PRR. Finally, to get the pulse width the local minimum is found and its frequency is subtracted from the IF frequency.

(Figure 8 DSP Flow Chart)

All code is written in Matlab in the form of m-files and are included in Appendix A.

Signal Detection The system has two levels of detection before the signal processing begins. Figure 9 illustrates this detection process. The signal must first pass Level 1 Detection, which determines if the signals amplitude is above a preset threshold level. For this system the threshold level was set to 200 mV. This threshold corresponds to about -20 dBm signal level on the input. Once Level 1 Detection has been passed, the signal must pass Level 2 Detection. During Level 2 Detection the system takes an FFT with a small number of points and then searches for the spikes on either side of the main spike. If these spikes are detected then a pulse radar signal has been detected and the signal can continue to be processed.

(Figure 9 Detection Process) Both Level 1 and Level 2 detection work in unison to decide if a radar signal has been detected. The goal is to provide multiple detection process to speed the system up by not wasting time performing full signal processing to determine if the signal is a pulse radar signal.

IV. Mathematical Verification The purpose of this section is to derive the relationships between the radar characteristics in the time domain and frequency domain. Figure 11 is the time domain representation of a pulsed radar signal. To obtain the FFT the signal is broken up into two components, which are then multiplied together.

(Figure 11 Time Domain Representation of Pulsed Radar Signal) The two time domain components are:
x1(t ) = cos( 2fRFT ) (1) t nT ) (2) x 2(t ) = A (
n

Then; g (t ) = x1(t ) x 2(t ) (3) Use Multiplication Theorem (table 2-1, Couch) x1(t ) x 2(t ) = X 1( f ) X 2( f ) (4) Using Fourier Transform (table 2-2, Couch) and Time Delay Theorem (table 2-1, Couch)

1 1 ( f fRF ) + ( f + fRF ) (5) 2 2 X 2( f ) = A sinc(f )e^ ( j 2fnT) (6) X 1( f ) =


n

G ( f ) = X 1( f ) X 2( f ) (7)

10

1 1 G ( f ) = ( f fRF ) + ( f + fRF ) Asinc(f )e^ ( j 2fnT) (8) 2 2 n A G( f ) = [ ( f fRF) *sinc( ( f fRF))e^ ( j2fnT) + ( f + fRF) *sinc( ( f + fRF))e^ ( j2fnT)] 2 n Using Frequency Shifting Property. (Haykin, pg.38-39) G( f ) =
G( f ) =

(9)

A 2 A
2

[sinc( ( f f
n
n

RF

))e^ ( j 2 ( f fRF)nT ) + sinc( ( f + fRF))e^ ( j 2 ( f + fRF)nT )]


A sinc( ( f + fRF )) e^ ( j 2 ( f + fRF )nT ) 2 n

sinc( ( f fRF )) e^ ( j 2 ( f fRF )nT ) +

Using Poisson Sum Formula. (Eqn 3-38, Couch) 1 n e^ ( j 2fnT ) = ( f ) T n = T n =


A 1 n A 1 n sinc( ( f fRF)) (( f fRF) ) + sinc( ( f + fRF)) (( f + fRF ) ) (12) 2 T n= 2 T n= T T Figure 12 below is a plot of the above equation. It shows the doubled sided sinc functions and how they are made up of the delta functions. G( f ) =

0.1

sinc( ( f + fRF )

sinc( ( f fRF )

[( f fRF ) ]n = 1

0.08

1 T 2 [( f fRF ) ]n = 2 T

0.06

0.04

0.02

-0.02

-0.04 -150

-100

-50

50

100

150

(Figure 12 Plot of G(f))

11

V. Design of IF Filter and Amplifier


The following section discusses the design of the IF filter and amplifier. All of the other system components are off the self; therefore, there is no design involved.

IF Filter For the IF filter a low-pass, fifth order, Butterworth design was chosen. Other active filter designs were rejected due to the stray capacitances associated with the bread board. This filter was implemented on vectorboard which better isolates components. Figure 13 is the schematic for the IF filter. The design comes from Radio Frequency Electronics by Jon Hagen. The filter design consists of two cascaded pi networks whose values were designed for a cutoff of 1 rad/sec and then unnormalized for a cutoff of 200 KHz.

(Figure 13 Low Pass IF Filter Schematic) Figure 14 is the experimental verification of the IF filter. The 3 dB point is at the designed for cutoff frequency of 200 KHz. However, the steady gain is about -5dB due to the 50 Ohm resistors, this problem is corrected when the filter is inserted into the system. The problem arises because the input and output loads are not matched.
Low Pass LC Butterworth Filter
0 10 -10 Magnitude [dB] -20 -30 -40 -50 -60 Frequency [KHz] 100 1000

3db Point at 200KHz

(Figure 14 Experimental Verification of IF Filter)

12

IF Amplifier Figure 15 is the circuit schematic for the IF amplifier. It is a LM741 op-amp in a non-inverting configuration. The purpose of the amplifier is to make up for signal loss that is encountered in various parts of the system. The design gain was 21 V/V; however, at the 100 KHz operating frequency it was 12 V/V. This drop in can was due to the 1.5MHz unity gain bandwidth associated with the LM741.

(Figure 15 IF Amplifier)

VI. Simulated Results


The Simulink block diagram for the system is shown in Figure 16. It includes the RF front end, local oscillator, and the IF filter. The filter is set for 200 KHz and the signal coming from the RF_signal block is the pulsed radar signal.

(Figure 16 System Simulation in Simulink)

13

For the simulation the RF signal is a 105 MHz sinusoid mixed with a 2 ms period, 20% duty cycle pulse train. The local oscillator signal is at 104.9 MHz, the output signal will be at FIF = FRF-FLO. Figure 17 is the time domain plot of the filtered IF signal.
1.5

0.5 Amplitude

-0.5

-1

-1.5

0.5

1.5 Time (sec)

2.5 x 10

3
-3

(Figure 17 Time Domain Plot of Simulated IF Signal) The signal processing scheme previously described is used to extract time domain information mathematically from the frequency domain. By taking an FFT of the signal, the time domain characteristics can be obtained as shown in Figure 10. The code to perform the calculations is in Appendix A. To find the original RF signal the LO frequency is added to the IF frequency. So 104.9 MHz added to 100 KHz is a 105 MHz. In Figure 18 the FFT of the IF signal is shown. The plot shows the frequency points from which the time domain characteristics are calculated. The corresponding variable locations are the same that were derived in section IV. It should be noted that this plot is a plot of the magnitude of the FFT. Since the FFT is has a limited number of points, about 40,000, there is not an exact zero point to calculate pulse width from. In this case an average value for that local minimum is determined.
11000 10000 9000 8000 7000 Amplitude 6000 5000 4000 3000 2000 1000 0 0.9 0.92 0.94 0.96 0.98 1 1.02 Frequency (Hz) 1.04 1.06 1.08 1.1 x 10
5

(Figure 18 Frequency Domain Plot of the IF Signal) 14

VII. Experimental Results


The test setup for the system is shown in Figure 19. All of the components are given and the signals are labeled. The oscilloscope was used at the input to the A/D to make sure that there was not a problem with the signal coming in. The function generator used for the radar signal has a frequency range from 250 KHz to 4 GHz. The test results can be found in appendix B.

(Figure 19 Setup for System Testing) In Figure 20 the time domain of a sampled signal can be seen. The frequency of the RF signal is 100 MHz and the Local Oscillator frequency is 99.9 MHz. Pulse repetition rate is 500 Hz and the pulse width is 400 uS (2500 Hz).

(Figure 20 Sampled Pulse Radar Signal in Matlab)

15

Figure 21 is the results for the signal in the frequency domain from the FFT, which is used to determine the characteristics of the radar signal. The IF frequency is center peak at 100 KHz as expected. Thus, LO + IF = 100 MHz which is correct. Also the PRR is determined to be 500 Hz and the pulse width is at 2500 Hz. All of the values match up and correlate with simulation results

(Figure 21 Experimental Results Frequency Domain)

VIII. Analysis of Results


The system specifications established in the initial phase of the project are listed below: 1. RF frequency range from 50 to 120 MHz 2. PRR from 500 to 10000 Hz (2 to 0.1 mS) 3. Pulse width up to 40 % The system had no problems in analyzing RF frequencies in the specified range. The system could go even higher; however, it was limited by the output of the frequency synthesizer. If the synthesizer would have been able to go above 120 MHz then I could have scanned all the way up to 500 MHz, which was the limiting frequency of the mixer and LO amplifier. The system was able to detect PRRs from 500 to 10000 Hz. The upper limit for PRR was 10000 Hz. For PRRs greater than 10000 Hz a higher resolution FFT would need to be used. PRRs lower than 500 Hz could be detected if the number of samples is increased to make sure that twice the period of the pulse was captured. The system was only able to detect pulse widths up to 25%. This was because of the resolution of the FFT vector. If the number of points was increased the systems scan time would be greatly increased as well. One of the areas where system performance was lacking was in the scan time which is the time it takes the system to scan the full 50 to 120 MHz range. It took 1 second to scan a 10 MHz

16

bandwidth. Therefore, to scan the full bandwidth it would take approximately 70 seconds. This is very slow and would not be suitable for a production system.

IX. Conclusions
The Project was an overall success. The specifications were not met exactly; however, the main objective was to make sure the system was able to automatically scan. The system was able to successfully scan the entire frequency range and detect and characterize a pulse radar signal with the range. Also there was no error when determining the PRR of the signal. Only when the signal reached 10000 Hz PRR was the system unable to detect it. The system could detect pulse widths up to 25%. Pulse widths greater than 25% require an increase in the number of points in the FFT vector. Even though it could not detect such large pulse widths that does not present very much of a problem, in radar systems is not practical to use large pulse widths because it wastes power and decreases possible chances of finding targets. One of the main reasons for the slow scanning rate was using Matlab to do my real time signal processing. Matlab is slow to take FFTs and scanning the large FFT vectors was also extremely slow. Another factor that slowed the system down is the fact that control of the frequency synthesizer was done with visual basic through the parallel port. The systems performance could be greatly increased if a DSP board and microcontroller replaced the PC. The DSP board would allow C code that could be generated by Simulink, to efficiently process the signal. Furthermore, the microcontroller could be used to control the AD 9854 Evaluation Board.

17

X. Datasheet
Table 1 is the datasheet for the Scanning Digital Radar Receiver. It describes input requirements and individual subsystem requirements. (Table 1 Scanning Digital Radar Receiver Datasheet)
Parameters SYSTEM SPECIFICATIONS Channel Scanning Time RF Power INPUT SPECIFICATIONS Carrier Frequency (fRF) Pulse Repetition Rate (PRR) Pulse Width (PW) Pulse Width (PW) Pulse Width (PW) Error 50 500 50 5 -10 120 10000 500 25 10 500 20 [MHz] [Hz] [us] [% of PRR] [us] 0.1 -20 70 -10 [Sec] [dBm] Min Max Typical Units

MIXER (ZAD-1) Frequency Range Average Conversion Loss (Refer to Datasheet for more spects) LOCAL OSSCILATOR (AD9854) Ouput Frequncy Step Size Clock Jitter (100 MHz) (for more specs refer to AD9854 datasheet) DATA ACQUISITION (IOTech 3005USB) Sampling Rate Number of Bits (for more specs refer to IOTech 3005USB datasheet) 1 16 1 16 [MHz] [bits] 0 0.1 300 120 1.00E+05 7 [MHz] [Hz] [Ps rms] D.C. 500 5.28 [MHz] [dB]

18

XI. Standards Relating to Project


The following is a list of standards documents that pertain to this project. Since the standards must be purchased, only there basic information is listed. Information was gathered from www.nssn.org. IEEE Standard Radar Definitions Author: IEEE Published: 4/27/1998 Document #: 686-1997 Early Warning Systems Author: Department of Defense (DoD) Published: 8/31/1995 Document #: QAP-124 ED.1 Electronic Counter-countermeasures in Radar Systems Acquisition Author: Department of Defense (DoD) Published: 6/05/1987 Document #: MIL-HDBK-293

XII. Patents Relating to Project


The following is a list of patents with abstracts that pertain to this project. Information was gathered from www.uspto.gov. Patents 5,010,341 4,860,013 6,879,281 6,587,072 4,504,830 6,693,578 High Pulse Repetition Frequency Early Warning Receiver Automatic Threshold Multi-channel Digital Radar Early Warning Sys. Pulse Radar Detection System Pulse Radar Detection System Synthetic Pulse Radar System and Method Mixer Optimization for Active Radar Warning Receiver

Patent Applications 20050179582 20050134502 20030193430 20040212358 Radar Detection Method and Apparatus Pulse Wave Radar Device Pulse Radar Detection System Scanning RF Receiver

19

References
Couch, Leon W., Digital and Analog Communication Systems, 3rd edition (New Jersey: Prentice-Hall, Inc. 1990) Haykin, Simon, Communication Systems, 3rd edition (1994) Mahafza, Bassem R., Radar Systems Analysis and Design Using Matlab, 2nd edition (New York: Chapman and Hall/CRC 2005)

20

Appendix A (Software)
The following software listings are m-files used during signal processing.
%This m-file intializes the A/D board using the Data Acquisition Toolbox. %Created by Ryan Hamor 03/6/2006 ai=analoginput('iotdaq',1,'setup_0.xml'); addchannel(ai,16); ai.channel.inputrange=[-1;1]; ai.samplespertrigger=4000; ai.samplerate=1e6; %m-file to take the sample data %created by Ryan Hamor 3/6/06 start(ai) data=getdata(ai); sig=data-mean(data); maxamp=max(sig); %sample the data %extract the sample from the engine %Take out DC %find max amplitude for threshold testing %create A/D object %setup channel and input info

%this m-file is responsible for detecting the difference between a pulse %waveform using a low resolution fft. The number of points is 2^12. %Using a power of 2 allows for faster fft's. fftamt=4096; sigfft=abs(fft(sig,fftamt)); nyq=fftamt/2; fc_mag=max(sigfft(1:nyq)); ptm=1; while sigfft(ptm)~=fc_mag ptm=ptm+1; end %Find the deltaR peak. p1=ptm; p2=p1+1; while sigfft(p1)>sigfft(p2) p1=p1+1; p2=p2+1; end while sigfft(p2)>sigfft(p1) p1=p1+1; p2=p2+1; end mag2=sigfft(p1); threshold if mag2 > det = else det = end = fc_mag/2 threshold 1 0 %Set the threshold level at 50% of max mag %set the fft length for %take fft %nyquist sampling point so no oversample %only search for the first peak %intialize maximum pointer

%Intialize pointers

21

%M-file to take the fft of a signal that meets intial threshold %requirements. It then finds it center frequency and the first delta %spikes on either side if present. If they are not 50% of the amplitude %of the center spike, then no signal is detected. %created by: Ryan Hamor 3/8/06. cond = 0; ts=length(sig); fftamt=10*ts; %Variable to set if a peak is ligitemate %set the fft length for 10 * number of %points. %take fft

sigfft=abs(fft(sig,fftamt)); %setup the freq scale freq=1e6*[0:fftamt-1]/fftamt; nyq=fftamt/2; %nyquist sampling point so no oversample fc_mag=max(sigfft(1:nyq)); %only search for the first peak ptm=1; %intialize maximum pointer while sigfft(ptm)~=fc_mag ptm=ptm+1; end fc=freq(ptm); %save the carrier frequency

%Find the deltaL and deltaR peaks. p1=ptm; %Intialize pointers p2=p1+1; while cond == 0 while sigfft(p1)>sigfft(p2) p1=p1+1; p2=p2+1; end while sigfft(p2)>sigfft(p1) p1=p1+1; p2=p2+1; end mag2=sigfft(p1); if mag2 > 0.4*fc_mag magdeltaR=sigfft(p1); %Save the location of the magnitude. fdeltaR=freq(p1); %Get the frequency of the delta on left cond = 1; %Set condition to get out of loop else p1=p1+1; p2=p2+1; end end %search for right side delta cond = 0; p1=ptm; p2=ptm-1; while cond == 0 while sigfft(p1)>sigfft(p2) p1=p1-1; p2=p2-1; end while sigfft(p2)>sigfft(p1) p1=p1-1;

22

p2=p2-1; end mag2=sigfft(p1); if mag2 > 0.4*fc_mag magdeltaL=sigfft(p1); fdeltaL=freq(p1); cond = 1; else p1=p1-1; p2=p2-1; end

%Set condition to get out of loop

end %Figure out if the signal is detected. avg_fdel=((fdeltaR-fc)+(fc-fdeltaL))/2; %computer average delta freq tPRR=1/avg_fdel; tPRR=tPRR*1e4; %Round the PRR to nearest 10,000th tPRR=round(tPRR); PRR=tPRR*1e-4;

%m-file to find the Pulse Width of a detected Pulse Radar Waveform. %The technique used is to count the delta spikes and figure the Pulse %Width from there. The code can only find Pulse Width that are equal or %less than 20%. %Created By: Ryan Hamor %3/20/06 %Intialize Variables p1 = ptm; p2 = p1+1; freq1=fc; mag1=fc_mag; cond=0; while cond == 0 while sigfft(p1)>sigfft(p2) p1=p1+1; p2=p2+1; end while sigfft(p2)>sigfft(p1) p1=p1+1; p2=p2+1; end freq2=freq(p1); mag2=sigfft(p1); if freq2-freq1 < avg_fdel + 30 if mag2 > 0.45*mag1 mag1 = mag2; freq1 = freq2; p1=p1+1; p2=p2+1; else p1=p1+1; %find peaks % % % % % % %**********

%this variable stays 0 until a PW is %found

%Check if ligitimate peak %set up new previous values

23

p2=p2+1; end else if mag2 > 0.45*mag1 Avg_Dis = (freq2+freq1)/2; freqPW = Avg_Dis-fc; PWt = 1/freqPW; cond = 1; else p1=p1+1; p2=p2+1; end end end %take average distance from fc %frequency of Pulse Width %set to break loop

The following is the code for the visual basic front end. Option Explicit 'Declare all variables. Option Base 1 'Lower array index = 1. Public Matlab As Object Public Result As String Public fc As Double, maxamp As Double, PRP As Double Public pulse_width As Double Public sigdet As Integer, per_PW As Integer, pulse_width_fin As Integer 'Created by Ryan Hamor 1/16/06 'Form version 1.0 added ablility to connect and disconnect from Automation Server 'Form version 1.1 added Subs, cmdLoadData and cmdSig_Proc to test m-files 01/19/06 'Form version 1.2 Removed testing sub routines and added the cmdIntAD and cmdScan_Click() 'this version has provisions to automatically scan once the LO setting are entered. '03/07/06 'From version 1.3 Added code to run second detection process 3/8/06 'Form version 1.4 Broke down code into subroutines for final testing and adding modes of operation. 4/19/06 Private Sub cmdIntAD_Click() 'Intializes the 3005USB A/D card through matlab 'Set working directory of matlab Result = Matlab.Execute("cd c:\RadarRec") 'Set the working directory Result = Matlab.Execute("intad") 'setup AD End Sub Private Sub cmdQuit_Click() 'Quit out of matlab server Matlab.Quit

24

End Sub Private Sub cmdScan_Click() 'This Subroutine starts the automatic scanning process and does not stop until the it is done scanning Scan: Call frmLO.IncLO Call Detect_Level1 If sigdet = 1 Then Call Detect_Level2 If sigdet = 2 Then Call Get_Char GoTo Done Else GoTo Scan txtstatus.Text = "Pulse Waveform Not Found" End If Else GoTo Scan End If Done: End Sub Private Sub cmdsetup_Click() 'Create Matlab Server Shared Set Matlab = CreateObject("Matlab.Application") End Sub Private Sub Detect_Level1() 'This will sample the data and determine if the there is a signal with appriate level present. Result = Matlab.Execute("sample") 'sample signal maxamp = Matlab.GetVariable("maxamp", "base") 'get maximum value of signal from matlab If maxamp >= 0.225 Then 'Check that there is a signal present txtstatus.Text = "Signal Found Determining if Pulse Waverform..." sigdet = 1 Else sigdet = 0 End If

25

End Sub Private Sub Detect_Level2() Dim det As Integer Result = Matlab.Execute("det_level2") det = Matlab.GetVariable("det", "base") If det = 1 Then sigdet = 2 Else sigdet = 0 End If End Sub Private Sub Get_Char() Dim curfreq As Double 'This subroutine gets characteristics of the waveform and displays them. Result = Matlab.Execute("detect") 'M-file to see if real pulse waveform and find PRR txtstatus.Text = "Pulse Waveform Found Please Wait for Characteristics..." Result = Matlab.Execute("PW") 'Executes m-file to find signal Pulse Width fc = Matlab.GetVariable("fc", "base") PRP = Matlab.GetVariable("PRR", "base") pulse_width = Matlab.GetVariable("PWt", "base") per_PW = pulse_width / PRP * 100 pulse_width_fin = pulse_width * 1000000 'convert to micro seconds PRP = PRP * 1000 'convert to milliseconds curfreq = CSng(frmLO.txtFWLO_MHZ.Text) + (0.000001 * fc) txtPW.Text = pulse_width_fin txtPW_percent.Text = per_PW txtfc.Text = fc txtPRR.Text = PRP txtRFfreq.Text = curfreq End Sub Private Sub Form_Load() Height = 7200 Width = 9700 Left = 100 Top = 100 End Sub 'Update text boxes

26

Appendix B (Test Results)

27

You might also like