discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] sensed spectrum in dB???


From: Brian Padalino
Subject: Re: [Discuss-gnuradio] sensed spectrum in dB???
Date: Tue, 23 Sep 2008 09:46:31 -0400

On Tue, Sep 23, 2008 at 9:35 AM, kaleem ahmad <address@hidden> wrote:
>
> Thanks Brian,
>
> But I am still confused what this code is doing:
>
>        power = 0
>        for tap in mywindow:
>            power += tap*tap
>
>        # FIXME the log10 primitive is dog slow
>        log = gr.nlog10_ff(10, self.fft_size,
>
> -20*math.log10(self.fft_size)-10*math.log10(power/self.fft_size))
>
>
> Especially why this factor
> "20*math.log10(self.fft_size)-10*math.log10(power/self.fft_size)" is used???

The loop is calculating the gain of the window and subtracting to
maintain unity.

> moreover nlog10_ff block actually computes -> n*log10(input) + k, can
> someone explain what this k is doing and how can we compare this formulae to
> traditional dB formulae i.e. 10log(input), or 20log(input).

I haven't read the code, but I suspect it's for situations as stated above.

Brian

PS - Top posting is a little bit of a waste of bandwidth.  Please try
some inline posting as it maintains a bit more clarity:

    http://en.wikipedia.org/wiki/Posting_style




reply via email to

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