If you look back at my earlier post on QAM, you will notice that in the modulator(transmitter side), you will notice that we are multiplying one signal by
and the other by
. These signals are generated by separating the original message signal into two signals, and then multiplying one by
and the other by
. Now, in the previous post I used a sinusoidal message signal for illustration. In reality, message signals are generally NOT perfect sinusoids.
Without further ado, here is the explanation of QAM (formulation heavily adapted from Telecommunication Breakdown by Johnson&Sethares)
Let the message
be separated into two signals
and
. Then we modulate by multiplying one by
and the other by
. In other words, if
is our modulated signal,
is generated by the following:
. This is the signal transmitted. At the receiver, in the demodulater, we duplicated the signal received: call these
and
.
=

. Putting this signal through a lowpass filter(filters high frequencies) gives
, and we have recovered the message.
Now, 
. With a lowpass filter, we get 
We can look at some IT++ code in the future
Categories: Telecommunications
(I originally published this post on my general blog).
Regular expressions are the alternative for full fledged parsers when there is lightweight parsing to do. For example they can be used to match a certain pattern in a file. They are available in all the scripting languages(Perl, Python, Ruby, Tcl, Shell scripting) and tacked on as a library in C++, Java, C#, etc. Here is an example in Ruby that finds floating-point numbers in a file(presumably for more processing with them).
Sample.txt has the following two lines:
#0 0.22 -3 -0.4
#0 5 3 7
Find.rb has the following content:
ary = Array.new
open(’sample.txt’).each do |line|
ary <</[-+]?[0-9]*\.[0-9]+/)
end
ary.each{|item| puts item }
Output of the code snippet is the following two lines
0.22
-0.4
You can check out my GPLed Regular Expression Tester here. Pay special attention to the disclaimers listed in the GPL as this little utility has NOT been tested very much.
Here is a language-neutral introduction to regular expressions(it also my reference for the post)
www.regular-expressions.info/
Categories: Cross-platform code · Ruby