discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Determine index of max value in FFT


From: Paul Boven
Subject: Re: [Discuss-gnuradio] Determine index of max value in FFT
Date: Mon, 30 Sep 2019 21:51:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Hi Tom,

On 9/30/19 3:27 PM, tom sutherland via Discuss-gnuradio wrote:
How do you determine the index of the maximum value of the output of a FFT? e.g. I have a FFT  and then a "ComplexToMag^2" block and I want to know the max value and its corresponding index (i.e. for a 4096 point FFT the index occured at 63).

The argmax block will give you the index to the vector element with the largest value. Set its number of inputs to 1, and the vector length as appropriate. The 'max_vec' output gives the number you are looking for.

As there is only one vector, the 'max_inp' should be connected to a null sink. (I would argue that the port in question should disappear when there's only one input).

For the value itself, there's the 'max' block, set number of inputs and length of output vector to 1.

Regards, Paul Boven.



reply via email to

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