Go Down

Topic: Question about magnitude (Read 2993 times) previous topic - next topic

Noisecontrol

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?
Adc factor how calculated?

PieterP

#46
Jun 14, 2018, 10:25 pm Last 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

For calculate mean window i must get avarage Vreal of window function ?

PieterP

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

Noisecontrol

Please explain about fft_sin
Is fft _sin complex number like A+jB?

PieterP

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

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

It is the magnitude of the results of the FFT.

Noisecontrol

Then magnitude per bin is equal  to sin_fft

PieterP


Noisecontrol

About ADC reference voltage, 
I use arduino uno and i want to use 5 volt pin
How much is v_ref?

PieterP


Noisecontrol

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 am Last 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

Yes. But because of windowing and discretization, you'll get non-zero values in neighboring bins.
I didnt understand you

Go Up