discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Strategy advice


From: Martin Dvh
Subject: Re: [Discuss-gnuradio] Strategy advice
Date: Fri, 19 Oct 2007 18:21:07 +0200
User-agent: Icedove 1.5.0.12 (X11/20070607)

Steven Clark wrote:
> All-
> 
> I was hoping I could get some advice on what is a good block-design strategy
> for the following problem.
> 
> I have two streams of complex samples coming in. I want a block or sequence
> of blocks which outputs the cosine of the phase difference between the two
> input streams.
> 
> If we could assert that both input streams are unit length, then one way to
> do it would be to conjugate one stream, then complex multiply the two
> together, then take the real part of the output. But if the input streams
> are NOT normalized, then the product will likely not be unit length either,
> and this won't work.
> 
> We could try and normalize the complex product, but the universe explodes if
> it has length 0 (divide by 0). Also, this would require a slow sqrt (?)
If your input streams have a rather stable amplitude you could put a slow  AGC 
in front of them to normalize.
You shoudl make sure that the vectors are length 1.0.
I remember using this trick and that I had to set the reflevel of the agc to 
1/srt(2) (in stead of 1.0)  or something like that to get it to
output vectors of length 1.0.

This will however not be as accurate as actually doing the slow sqrt() for 
every sample.



> Is the best approach to just get the phase of the complex product via
> fast_atan2f, then take the cos of that?
I am working on an SSE optimized version of atan2.
It is not fully checked and so not ready for primetime but maybe this would 
work for you.
How much in a hurry are you?

> Do any basic math/trig functions (cos, atan2, sqrt, etc) exist at the python
> block level, or do I have to delve into C to use them?
> Makefiles are scary :(
No they are not ;-)
Get them to know better and they will be your friends.

> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio





reply via email to

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