Go Down

Noisecontrol #45
Jun 14, 2018, 09:42 pm
corrected_fft = fft_sine / N * 2 / mean_window * V_ref / ADC_factor;

What is fft_sin and N and mean_window and v_ref and adc factor?

fft_sin is magnituid in per bin?
N is samples for example 128?
mean_window what is it and how calculated?
V_ref is 5 or 3.3 volt?

PieterP #46
Jun 14, 2018, 10:25 pmLast Edit: Jun 14, 2018, 10:26 pm by PieterP
They're defined above.

fft_sine is the result of the FFT, either as complex number, or the modulus of that complex number.
N is the number of bins (or the number of samples).
mean_window is the average value of the window function you're using.
V_ref is the ADC reference voltage, it depends on what Arduino you're using and how it's configured.
ADC_factor = 2^10 = 1024 if you're using the internal 10-bit ADC.

Noisecontrol #47
Jun 14, 2018, 10:49 pm
For calculate mean window i must get avarage Vreal of window function ?

PieterP #48
Jun 14, 2018, 11:01 pmLast Edit: Jun 14, 2018, 11:02 pm by PieterP
The window function is real by definition. But yes.

Noisecontrol #49
Jun 14, 2018, 11:37 pm
Is fft _sin complex number like A+jB?

PieterP #50
Jun 14, 2018, 11:41 pm
It's more efficient if you calculate the modulus first, but from a mathematical standpoint it doesn't matter, because |r(a+bi)| = r|a+bi|.

It is the result of the FFT, and you want the magnitude, so you take the modulus. Then you multiply that modulus by the aforementioned correction factors.

Noisecontrol #51
Jun 15, 2018, 12:05 am
I didnt understand
My english is not good please say simple to do it
Sin_fft is equal to magnitude or not?
If not how can i calculate sin_fft

PieterP #52
Jun 15, 2018, 12:07 am
It is the magnitude of the results of the FFT.

Noisecontrol #53
Jun 15, 2018, 08:02 am
Then magnitude per bin is equal  to sin_fft

PieterP #54
Yes.

Noisecontrol #55
Jun 15, 2018, 09:25 am
I use arduino uno and i want to use 5 volt pin
How much is v_ref?

PieterP #56
Jun 15, 2018, 09:38 am
Then V_ref is 5V.

Noisecontrol #57
Jun 15, 2018, 09:52 am
After calculating correct_fft, the value of correct_fft will be in terms of voltage in per bin?

PieterP #58
Jun 15, 2018, 10:01 amLast Edit: Jun 15, 2018, 10:01 am by PieterP
Yes. But because of windowing and discretization, you'll get non-zero values in neighboring bins.

Noisecontrol #59
Jun 15, 2018, 10:22 am
Yes. But because of windowing and discretization, you'll get non-zero values in neighboring bins.
I didnt understand you

Go Up