Lab3: The Fast Fourier Transform and a Wearable Personal Safety Device with a Radar Vision system for detecting crime before it happens

We have seen Mary Baker Eddy with one eye!
---cryptic sentence inserted into commercial short-wave broadcast to inform British Royal Radar Establishment of the invention of the T/R (Transmit/Receive) switch allowing a single radar antenna to be used for both transmitting and receiving (having seen the Christian Science building with just one antenna).

To be submitted as paper printout, into the drop box on the 4th floor of Galbraith Building.
NOTES FROM OMID: ``I prefer paper printout (drop-in-box) please. BTW, should students need to talk to me in person, I will be available in my lab (Bahen 4158) from 3 to 5 today (Saturday). In any case, I'll check and answer emailed questions on a regular bases.''

Some implementations of Octave make image arrays upside down, so if this happens, either use the flipud command, or remove a flipud command that may have been present in scripts written for a different implementation, e.g. change tvs(X, Y, flipud(-ZZlog)) to tvs(X, Y, -ZZlog), or the like

In class, we learned how to implement the Discrete Fourier Transform (DFT), and how to compute it efficiently using Decimation In Time (DIT) and Decimation In Frequency (DIF), etc.. We also learned about windows, and, in particular, we learned about sliding windows where the window moves through time to show a varying spectral information.

This approach to Fourier analysis is called "Time Frequency" (TF) analysis, which will form the basis of this lab.

Various matlab (or octave) scripts and data files are provided for you, in this lab3 directory. See for example, READMEscripts and READMEdata from the lab3 directory.


You may wish to read this introduction,, if you'd like to learn more about the Personal Safety Device (PSD) that generated the datasets, and have some additional background for answering the questions, or you can also proceed directly to the lab3 directory and give a try at the questions below, perhaps referring to the above introduction after you've tried the various scripts, etc.:

BE SURE TO START OCTAVE (or matlab which is the proprietary octave-like system) FROM THE lab3 DIRECTORY, SO THE path or programs (or equiv. octave path) IS SET TO INCLUDE THE CURRENT WORKING DIRECTORY, etc..


First run tests.m to get a sense of some examples of some of the datasets. Also see READMEdata. The tests.m file will load in these datasets which are used for some of the runs below:

Plot tfhandtv for uncalibrated pickpocket, e.g. load pickpocket2.txt, then compute zc=complexify(pickpocket2); and then plot using tfhandtv.m. Alternatively you can run showcal.m to see the difference between calibrated and uncalibrated data. See READMEscripts for an explanation of tfhandtv and other scripts. You can generate these plots automatically by simply running showcal.m which will also show you a real versus imaginary plot of the radar data.

Problem 1: Explain the physical and intuitive meaning of the difference between positive and negative frequencies. What is negative frequency?

Problem 2: Notice that the uncalibrated radar data causes mirroring in the f=0 axis (e.g. an inability to distinguish positive from negative frequencies). Comment on why the calibration procedure (e.g. calibrateradar.m) mitigates this problem.

Problem 3: Look at the car3 data (possibly modify showcal.m for this purpose) and propose a possible explanation for why the car3 data appears to be partially reflected in the frequency=0 axis even after running calibrateradar.m on it.

Problem 4: Suggest how you might use the spectral analysis (Fast Fourier Transform) information obtained from tfhandtv.m to see whether or not a given situation may be dangerous. Describe the characteristics of possible dangerous situations as seen through the eye of the radar. Make particular reference to Fourier analysis. Devise a method of detecting danger that can distinguish from among some of the various radar targets.

Problem 5: An engineer starts a company to manufacture a hands-free cursor pointing device to replace the mice usually used on a computer. The device can either be placed on a desktop (or below the desk since it can see through wood) to sense the user's hand, or it may be worn on the front of the body so it can sense hand position while the user is mobile. Suggest how you might use a miniature radar as a pointing device. Engineer A decides to spin the radar around in the radome and obtain a radar image of a user's hand, and select the brightest pixel in the image as the position of the hand. Engineer B decides to use a single pixel of the radar image, and use phase for one axis of the pointer, and magnitude for another. Which engineer has a better solution, and why? If you paid attention in class when the radar was demonstrated, this should be very easy to answer.

BONUS PROBLEM: The above problems are sufficient for obtaining a 100% grade on this lab, if done well. However, if you like, you may attempt this optional bonus problem: Compute the chirplet transforms of some of the datasets. (Take a look at the files in the "chirplet" directory, and also be sure to put the .octaverc file into your starting directory so that the path to the "chirplet" directory gets included in your octave path.) Note that this takes a long time to compute. Use the script ff.m and explain what this script does, and what is meant by Frequency Frequency (FF) analysis. Explain why the Chirplet transform is particularly well suited to the analysis of radar data, and its benefits over and beyond Fourier analysis, and devise a classifier that can classify the various radar targets. Your classifier must work on other radar datasets, not just the data provided in this lab.

Not necessary for this lab, but perhaps of additional interest, is a short paper on time frequency analysis.

You will hopefully soon be out in industry, or in graduate school. You must learn how to think independently and to solve problems creatively. Hopefully this lab has been enjoyable.

If you are interested in learning more about the chirplet transform and radar vision, you can also download a recent draft of a paper on wearable chirplet based radar vision system.
download all of lab3
Most modern hard drives, even older ones, have several gigabytes of hard drive space, so the above file should take up significantly less than one percent of your total hard drive space when fully uncompressed and expanded. Even old computers I have salvaged from dumpsters typically have 500 megabytes or more, and a computer I recently purchased from Active Surplus for less than ten dollars ($7.49) had enough hard drive space that this entire lab took less than 10% of the hard drive space when fully expanded.

However, if you do have a computer that, for some reason, cannot handle the space requirements of this lab, you might want to download the lab3 programs and documentation with no data and then download the datafiles individually.

Datafiles not present in the lab3nodata archive but present only in the lab3 archive are textfiles, and ".mat" (matrix) files: