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