discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] phase difference between two real sinusoids


From: Morgan Redfield
Subject: [Discuss-gnuradio] phase difference between two real sinusoids
Date: Fri, 18 Apr 2008 10:40:03 -0700

Greetings,

I'm currently trying to find the phase difference between two real sinusoids. After looking through the archives of the mailing list, I found the following method:

src1_f=your first source of data  
src2_f=your second source of data 

hilbert_coeffs = gr.firdes.hilbert (27)
filter1 = gr.fir_filter_fcc(1, hilbert_coeffs)
filter2 = gr.fir_filter_fcc(1, hilbert_coeffs)
fg.connect(self.src1_f, self.filter1)
fg.connect(self.src2_f, self.filter2)

mult=gr.multiply_cc() 
c2conj=gr.conjugate_cc() 
c2arg=gr.complex_to_arg() 

fg.connect(filter1,(mult,0)) 
fg.connect(filter2,c2conj,(mult,1))
fg.connect(mult,c2arg)

avg_alpha=0.01 
avg=gr.single_pole_iir_filter_ff  (  avg_alpha ) 
fg.connect(c2arg,avg)

The problem with this method is that I'm starting out with two streams of floats. I'm using a hilbert filter to turn my signals into complex values, but when I do this my phase output is always in the range [0, 180] instead of [-180,180]. The magnitude of the phase seems to be accurate. Does anyone know how I can get around this?

Thanks,
Morgan Redfield

reply via email to

[Prev in Thread] Current Thread [Next in Thread]