[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Angle manipulation & other concerns
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] Angle manipulation & other concerns |
Date: |
Mon, 20 Feb 2006 12:06:15 -0800 |
User-agent: |
Mutt/1.5.9i |
On Mon, Feb 20, 2006 at 09:56:52AM +0100, Martin Dvh wrote:
> joe j wrote:
>
>
> src1=your first source of complex data
> src2=your second source of complex data
> mult=gr.multiply_cc()
> c2conj=gr.conjugate_cc()
> dummy=gr.add_const_cc(0.0) #This is just a block which should have the same
> delay as c2conj and do nothing further
> c2arg=gr.complex_to_arg()
> fg.connect(src1,dummy,(mult,0))
> fg.connect(src2,c2conj,(mult,1)
> fg.connect(mult,c2arg)
>
> Now the output of c2arg should have the angle of the phase difference
> between your two signals.
> You could put an average block after that to filter the phase difference
> avg_alpha=0.01
> avg=gr.single_pole_iir_filter_ff ( avg_alpha )
> fg.connect(c2arg,avg)
>
> explanation:
> If you multiply a signal with the conjugate of another complex signal, the
> output is a complex signal with amplitude=amp1*amp2 and phase=phase1-phase2
> This is why you get a real signal if you multiply a signal with the
> conjugate of itsself.
> The dummy in the above script is just a hack so every path has the same
> (processing) delay. To do this the "right" way you should put all
> this in one processing block. (That is the only way to be sure
> everything has the same processing delay)
FYI, you don't need the dummy block.
Just use
src1=your first source of complex data
src2=your second source of complex data
c2conj=gr.conjugate_cc()
mult=gr.multiply_cc()
c2arg=gr.complex_to_arg()
fg.connect(src1, (mult,0))
fg.connect(src2, c2conj, (mult,1)
fg.connect(mult, c2arg)
Eric