Friday, January 28, 2011

More SAR

SAR'd the following scene:

which generates the following image:

which shows the wall edge at ~20 feet. The image is reflected from the actual scene because we reversed the direction we swept the sensor without changing it in code.

Thursday, January 27, 2011

Synthetic Aperture Radar!

Adam, who's on the team with me, generated the following images with the code that Greg Charvat provided.

It looks pretty plausible! Here is the scene:

Adam and I acquired the SAR data last night(/morning) right outside 32-123. The two strong objects nearby are the door to 32-123 and the polygonal column. The reflections at 150 feet appear to be the cylindrical column on the right garnished with metal chairs. The center reflections at around 0-60 feet are likely reflections from the floor.

It was possibly one of the worst nights we could have tried to collect the data; some people were playing laser tag but they kept to the Gates side.

Worst. Sonogram. Ever

We took a series of range profiles along a linear axis at two inch increments in order to try to do Synthetic Aperture Radar (SAR)

 I thought I'd try a naive, intuitive algorithm for reconstructing the SAR scene


Monday, January 24, 2011

Cleaner Ranging and Multiple Targets

I got my friend Rachel to be an additional target. You should be able to make out the both of us in the range vs. time plot. We cross paths twice. Here is the original screen cap.

I decreased the time constant in the complementary IIR filter that subtracts static objects from the range measurements. That means that static objects decay more quickly. This seems to have helped a lot in the clutter. I also try to compensate for free-space path loss (signals which propagate further decay). Greg Charvat suggests using the model that the signal decay is proportional to (R^3/2) where R is the distance traveled. Since I'm plotting log of intensity of the frequency components over time, I just add 3/2(log R).  Any scaling difference in R manifests itself as a shift. Since I am streaming the spectrogram in real-time, I haven't yet done anything to try to maximize the contrast in the spectrogram. That would probably make the trajectories appear much more clearly.

Saturday, January 22, 2011

Radar Ranging

I think I got some pretty okay ranging results. You've got to use your imagination to make it out. I resorted again to taking a screen capture of my webcam and the radar data...

The embedded videos are downsampled. Here's the original screen cap.
Notice that, as I scooter away, there is an increasing frequency component. As I scooter back there is a component that is decreasing in frequency. See if you can discern the difference in rising and falling slope. I'm going faster on the return than I am during the departure.

The "Spectrum" graph on the left is a low-pass filtered version of the ranging signal. This is subtracted from the current ranging information so that in the spectrogram only moving reflections are shown. Even with this, there is a lot of "clutter" in the radar image. Also, I'd like to improve the dynamic range. The higher frequency components in the ranging data are a result of reflections from farther away. These signals are attenuated due to free-space path loss. Confer, for example, with when I am right in front of the antennas and there is a significant red mass on the spectrogram.

Friday, January 21, 2011

On Cars

I went on the corner of Memorial Dr. and Ames St. this morning and pointed the brightly colored cans at the cars. A friendly guy who's applying to Sloan for an MBA walked by (on his way, presumably) and chatted.

I wish I could the spectrogram program to output audio and stream the display at once (right now I can either have choppy audio and perfectly smooth display, or perfect audio and choppy display). Then I would have included the audio synchronized to the display in the video.

I don't think I can embed audio files, so here is the wave or the ogg.

Both in the specgram and in the audio file, I've filtered out everything above about 1kHz. I've also replicated the first half, but sped up by 2. This makes it easier to perceive the whale calls.

It'd be interesting to know why the frequency drops off like it does. The cars are not actually slowing down as they pass me by. Also, when you're on the train platform and you hear the "Eeeeeaaooo" (supposed to sound like a cat's meow without the 'm'), that's not purely because of the Doppler effect, because since the train is moving at a constant speed, the amount of Doppler shift would be constant.

Made in Inkscape

(I wish Blogger'd let me upload an svg.) So the speed actually observed as the car moves in and out of the antenna's range varies. For example, have the observation take place at the origin. As the car moves left, the observed speed decreases since less of the car's velocity lies in the direction of the measurement (the dotted line from the origin to the car). The moment the car passes the origin, this line is perpendicular and at this point the car appears instantaneously still. Let h=1. The ratio of the car's velocity that is in the direction of the dotted line is equal to the cosine of the angle a. sohcahtoa so cos(a) = x/sqrt(1+x^2)
WolframAlpha : y=x/sqrt(1+x^2)

Which looks (the positive part) similar to the way the frequency rolls off in our measurements (barring a reflection since time on the spectrogram is increasing right to left):

EEeeeaaaaooooow (Doppler Effect)


I'm uploading a funkily-dimensioned video. It makes me feel pretty bad in terms of fidelity/efficiency. It's a screen capture of my laptop webcam and a wx/Chaco/python application displaying the input from the soundcard. I'll try to do this better next time (by actually using a video compositing program).

So the video depicts the radar detecting the speed of my hand. Maybe it's time for me to describe this system a bit more. The system operates between 2.315-2.536 GHz (that's the nominal spec. on the VCO, a Mini-Circuits ZX95-2536C-S+). The signal being transmitted and the signal being received are multiplied together ("frequency mixed"). Multiplying two sinusoids together produces two different sinusoids: one with frequency equal to the sum and one with frequency equal to the difference of the original sinusoids being multiplied. I think the easiest way to convince yourself is with complex exponentials. But then you have to convince yourself that complex exponentials work. And probably the best way to do that is with Taylor serie--somuchmathscaffolding. Also a digression.

Right. So the frequency corresponding to the sum is somewhere in 5Ghz range and I'm not going to do anything with that. Maybe it dies thanks to the parasitic capacitance on one rail of the breadboard, but it definitely dies by after the first stage of the op-amp MAX414, which is rated at 28MHz. The frequency equal to the difference contains neat information in an easy-to-process form. It contains the amount of Doppler shift!

Doppler shift occurs when some source of waves (a reflector or a transmitter) is moving relative to the point where the waves are observed (the receiver). You might imagine that if the wave source moves at the speed at which waves propagate, then all the wavefronts get smashed together and maybe the wavelength goes to zero and sonic boom. I don't know how valid this is. I'm just the software guy?

Anyway, things are moving pretty slowly relative to the speed of light so it should be okay to use the non-relativistic Doppler formulation. For a source moving toward/away from a receiver at 1 m/s transmitting at 2.4 GHz at a speed c=3*10^9, the received signal is 2.4GHz +/- 8 Hz. So the difference is 8Hz and this is the frequency measured at the output of the frequency mixer.The frequency difference scales linearly with the speed, so a speed of 10m/s, the difference would be 80Hz. My intuition says that there is a factor of two involved when measuring the speed of a reflector, but I need to check this.

As an exercise to determine how feasible it is to use LaTeX markup in blogger (answer: not very?) I wanted to convince you that multiplying to signals together produces the sum and difference in frequency:

Notice that if there were a phase shift (in order to generalize the above) it would just appear as a complex amplitude in front of each exponential but the sum/difference of frequencies would still hold.

This should make it more evident that this circuit cannot tell whether an object is moving toward or away from the receiver, but only the speed of the object.

The amplitude of the output from the mixer depends on how strong the reflection is. When the reflector (my hand) is closer to the cantennae (j.k. : cantennas) the signal is stronger. To emphasize: the frequency of the output of the frequency mixer is proportional to the speed of the reflector.

More on the code that generated the plots: I've enjoyed using Python for "scientific computing". It uses the NumPy and SciPy matrix/math libraries and PyAudio (bindings for PortAudio) to capture. The plots are being done with Chaco ( by Enthought) with a wx backend. The code is heavily based on an example by Enthought. All these software projects are open source, so that's pretty nice.


Kit Assembled-ish

I borrowed Stephan's DSLR (I left my camera at home over the winter break) and took some pictures of what the system looks like tonight, which isn't much different than what it looked like 6 days ago except that things are secured. A lot of things are  wrong with the picture (aside from the top view being over exposed and showing my foot and aside from my taking the first picture with a probably-too-narrow depth of field (I can blame it on the auto. setting)). The batteries aren't secured properly and the breadboard's kind of messy.

Radar Intro. Also my first substantial blog post.

This IAP I'm taking "Build a Small Radar System Capable of Sensing Range, Doppler, and Synthetic Aperture Radar Imaging". The class started two Mondays ago and we received the kit of parts last Friday (the class meets Mondays and Fridays only). I probably should have started documenting the project then, but I'm going to try to synthesize the progress.

Monday's lecture was on history of RADAR (hmm I should write "radar"). They briefly went over the kit and the part that intrigued me was that the same oscillator was used for the transmitting antenna and the local oscillator for the receive antenna. I didn't understand how it was possible to do ranging given that it's not possible to pulse the VCO without being deaf to RF signals. Ahh: pulse compression. More on this another day, maybe? It's not hard.

Friday's lecture was on antenna propagation and probably discussed Smith charts. I, for some reason, thought class started an hour later than it actually did so I missed this part. Incidentally there was one question on Smith charts on the "Extra Class" level (highest level) of the Ham radio exam I took yesterday which I did not pass. I passed the first two levels and should be getting my callsign soon if not already but I don't know because the FCC call sign database has not been working properly much of today. Whoa: end digression.

Actually, end post.

Wednesday, January 19, 2011