Go Down

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

PieterP

#60
Jun 15, 2018, 10:38 am Last Edit: Jun 15, 2018, 10:38 am by PieterP
Take a look at the image I posted earlier. You start with a 64 Hz sine wave of 1.25 V peak. The corrected FFT shows an amplitude of 1.25 in the 64 Hz bin, as you would expect, but the 62 Hz and 66 Hz bins are not zero.

Noisecontrol

Understood your means
What is reason of it?

PieterP

Because of the windowing, in this case. But you get the same problem if your input frequency is not an integer multiple of the bin frequency. There's not much you can do about it.

Are you still trying to do A-weighting?

Noisecontrol

Maybe because of a slight oscillation in the main frequency. If the distance between frequencies increases, this problem can be solved

Noisecontrol

#64
Jun 15, 2018, 11:00 am Last Edit: Jun 15, 2018, 11:02 am by Noisecontrol
I try to analize sound and then caculated dB flat in per bin if it be corrected by a reffrence sound level meter,I can convert dB flat to A weighting and test it.but the hardest part of this project make a amplifire microphon and messurment adc and convert to voltage in per bin by fft.
I try and show my code to you to help me about it
Thanks a lot

PieterP

A-weighting is normally done in the time-domain, using analog filters. Newer devices use digital filters. I couldn't find any online references on using FFT for A-weighting.
If your goal is to create a working A-weighting system, I'd use digital filters.
If you want to learn about DSP and the Fourier transform, to try a new approach to A-weighting, I think you'll have to study the maths behind it first.

Noisecontrol

I find a circuit for a weighting
Is it your means?

Noisecontrol

If you see some sound level meter aplication that analized sound in dBA  like audiotools , i think it a-weighting by fft cuz there are no any circuit to do a_weighting in mobile

PieterP

I'm pretty sure that it uses digital filters. You can "convert" analog filters to digital filters. The bilinear transform does exactly that, for example. It's a first-order approximation, but it should do the trick.

Noisecontrol

How a android mobile do digital filter?

PieterP

Probably using cascaded digital BiQuad filters.
You factor the discrete-time transfer function into second-order polynomials (both the numerator and the denominator), and then you use the coefficients of these polynomials as the coefficients of the BiQuad filters.

Or you could calculate the convolution of the difference equation explicitly. But I think that could result in numeric instability.

Either way, it's going to be much easier than using an FFT.

Noisecontrol

Can do it by aurdino?
How can i find sample of it in arduino code?

MarkT

Understood your means
What is reason of it?

The fourier transform is only mathematically defined for periodic waveforms (that repeat for ever)
The DFT (of which FFT is an implementation) is only meaningful if the signal wraps around to the
beginning seamlessly - otherwise you have to use a window to reduce (but not eliminate) wrap-around
artifacts.

The best window is probably Kaiser-Bessel.  It takes a tuning parameter so you can select the properties
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Noisecontrol

Can do bilinear transform by aurdino?
How can i find sample of it in arduino code?

MarkT

Can do bilinear transform by aurdino?
How can i find sample of it in arduino code?
No, you do this as filter design time - the easiest way to design digital filters
is to find an online calculator, but normally they only exist for low-pass, band-pass
or high-pass, not a specific weighting function.

So the idea is find an analog A-weighting filter, put its poles and zeroes through
the bilinear transform to get Z-transform poles and zeroes, and feed that into
a digital filter tool.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up