DSPRelated.com
Forums

what filter to use in Scilab for I/Q demodulation of a signal

Started by maxplanck January 15, 2008
I'm trying to find the imaginary and real parts (I and Q) of a bandpass
signal (i'll call this bandpass signal "s").

To find the imaginary part, i first multiply the bandpass signal (s) by
sin(2*pi*t*fc), where t is the time in seconds and fc is the center
frequency of the signal's energy distribution.

s * sin(2*pi*t*fc) = m

Next, i need to low pass filter this signal (m).  This filtering must not
attenuate any frequency below 0.5*fc, and it must completely remove all
frequencies at and above 1.5*fc.  (right?)  After filtering, i should be
left with the imaginary part (Q).  (right?)

My best guess would be to use a FIR low pass filter, and set the cutoff
frequency and attenuation slope of the filter such that the cutoff slope
begins at 0.5*fc and ends at 1.5*fc.  Does this sound like the best way to
set up the filter?

If so (or if you know a better way), how can i implement this filtering in
Scilab?  Is the "wfir" function the one that i should use?  

I've tried using wfir, and i know how to set it to lowpass mode and to set
its cutoff frequency and slope to the values described above.  However,
once I set these values, do I simply multiply wfir by m in order to apply
this filter to the signal m?  I've tried doing this, but Scilab tells me
"Undefined operation for the given operands".  Sorry for my noobishness,
but can someone please tell me how to actually apply this filter to a
signal in scilab? (i've checked the scilab help file and tutorials, i'm
still stumped)


Thanks, any help would be much appreciated
you could multiply with exp(-i 2 pi f t). This downconverts your bandpass
signal around fc to a complex lowpass signal around 0 Hz.
Then use (real-valued) lowpass filters on real and imaginary part,
respectively. The highest frequency component of either is half the
bandwidth.
>you could multiply with exp(-i 2 pi f t). This downconverts your bandpass >signal around fc to a complex lowpass signal around 0 Hz.
Isn't this multiplication and downconversion done by multiplying by sin(2 pi f t)? It's impossible to directly multiply by exp(-i 2 pi f t) since we can't make numerical calculations involving sqrt(-1), so we get around this by multiplying by sin(2 pi f t), which contains a factor of exp(-i 2 pi f t), right? sin(2 pi f t) = j * (e^(-j 2 pi f t)-e^(j 2 pi f t))/2 According to Figure 14 in this text (page 13), http://www.dspguru.com/info/tutor/QuadSignals.pdf multiplying with sin(2 pi f t) both downconverts and upconverts the signal, therefore it's necessary to lowpass filter this signal in order to get rid of the upconverted part (am i right here?) http://www.dspguru.com/info/tutor/QuadSignals.pdf
>Then use (real-valued) lowpass filters on real and imaginary part, >respectively. The highest frequency component of either is half the >bandwidth.
This is what i just described, right?
>you could multiply with exp(-i 2 pi f t). This downconverts your bandpass >signal around fc to a complex lowpass signal around 0 Hz. >Then use (real-valued) lowpass filters on real and imaginary part, >respectively. The highest frequency component of either is half the >bandwidth.
Can you recommend a tutorial that explains how this works in greater detail, and the mathematical background? I read this: http://www.dspguru.com/info/tutor/QuadSignals.pdf and this: http://cmclab.rice.edu/433/notes/Fitz_BandpassNotes.pdf which cover euler's identity (e^it)=cos(it)+isin(it), e^(j pi/2)=j, complex exponential definition of sin and cos, and an example of I/Q demodulation. What you are suggesting that I do differs a lot from the example of I/Q demodulation in QuadSignals.pdf, and i'd just like to understand it more before i try it. Also, does anyone have anything to say about the following, am i right or wrong here?:
>you could multiply with exp(-i 2 pi f t). This downconverts your
bandpass
>signal around fc to a complex lowpass signal around 0 Hz.
Isn't this multiplication and downconversion done by multiplying by sin(2 pi f t)? It's impossible to directly multiply by exp(-i 2 pi f t) since we can't make numerical calculations involving sqrt(-1), so we get around this by multiplying by sin(2 pi f t), which contains a factor of exp(-i 2 pi f t), right? sin(2 pi f t) = j * (e^(-j 2 pi f t)-e^(j 2 pi f t))/2 According to Figure 14 in this text (page 13), http://www.dspguru.com/info/tutor/QuadSignals.pdf multiplying with sin(2 pi f t) both downconverts and upconverts the signal, therefore it's necessary to lowpass filter this signal in order to get rid of the upconverted part (am i right here?) http://www.dspguru.com/info/tutor/QuadSignals.pdf
>Then use (real-valued) lowpass filters on real and imaginary part, >respectively. The highest frequency component of either is half the >bandwidth.
This is what i just described, right?
>It's impossible to directly multiply by exp(-i 2 pi f t) since we can't >make numerical calculations involving sqrt(-1), so we get around this by >multiplying by sin(2 pi f t), which contains a factor of exp(-i 2 pi f
t),
>right?
partly. as you stated, real-valued multiplying with sin() involves downconversion AND upconversion. Complex valued multiplication with exp(-i...) results ONLY in downconversion. So the two can't be the same. If you're stuck with real numbers, you can of course implement complex multiplication using several real-valued operations. That's what happens in a direct conversion receiver, for example, since a baseband voltage is real valued. So it is split into in-phase and quadrature branch, and one uses sine and cosine wave for mixing.