|
From: | Marcus Müller |
Subject: | Re: [Discuss-gnuradio] The threshold of energy detection |
Date: | Fri, 12 Feb 2016 12:51:33 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
Hi Yan, The threshold block converts your signal to 1 if you've been above the "high" value, unless it has fallen below "low" again. Everywhere else, it's 0. See the "documentation" tab in the block properties, or the GNU Radio doxygen manual [1]. But: Parseval's theorem states that energy in frequency and in time domain are directly proportional, so your stream to vector -> FFT->complex to mag²-> vector to stream>moving average can simply be replaced with a complex to mag²->moving average if detecting the average energy in your signal is all you want , which seems probable, seeing that length(average)≈length(FFT). I'm not quite sure what your original intention was when storing (FFT->mag²->average) samples in test_sensor/out.dat; the signal after moving averaging is neither really frequency nor time domain. Out of curiosity: what do you want with that data? There's very valid applications for frequency domain filters (a moving average is actually but a low pass FIR filter, in principle), but the convolution that filtering usually means is often replaced with a multiplication in time domain, which is much less CPU-intense and mathematically equivalent! Best regards, Marcus [1] https://gnuradio.org/doc/doxygen/classgr_1_1blocks_1_1threshold__ff.html#details ¹ For new applications, I recommend Qt rather than WX -- the latter isn't going to be around forever. On 12.02.2016 12:02, Yan Huang wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |