Go Down

Topic: Sound analyizing (Read 1 time) previous topic - next topic

MarkT

Your highest frequency of interest is 11360Hz, so a sampling rate of ~30kHz is enough, given a brick-wall
analog anti-aliasing filter is employed to prevent frequencies above ~15kHz folding back.

One approach is simply to go to 40kHz sampling rate anyway, avoid the anti-aliasing filter, and then
run several bandpass digital filters on the samples to pull out the channels and separately calculate
running rms power estimates for each band.  With crude low-pole-count IIR filters for each band this
might be less computation than FFT or FCT

However for true A-weighting you kind of need the detail of an FFT output produces to do the weighting properly
if accuracy is important, since the weighting varies appreciably across each octave.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

MarkT

Your mean ardunio can not analize sound at least to 8000 hz?
Idont know about FFT ,i just want source code for analize and then change something i need for achive to a weighting and show dB
Its a small 8-bit microcontroller, not a DSP chip.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Noisecontrol

#17
May 29, 2018, 04:16 pm Last Edit: May 29, 2018, 04:20 pm by Noisecontrol
Its a small 8-bit microcontroller, not a DSP chip.
I want to analyiz sound into bands and get ampltiude value of per band then by regresion convert amplituid to dB and then decrase value of a_wiething of it
Understand my mean?
I dont want to make a wighing chipset
Even consider till 4000 hz ,cuz noise in industrial usually is 250 till 4000 hz and then wighting it

Noisecontrol

An aplication on android mobile can do analyize sound in octavband
Do arduino uno dont able it?
I see some video in youtube that analize sound

DVDdoug

I've never used the FFT or FHT library so I'm not sure what's wrong...

FFT (and FHT) is "imperfect".

Do you have a 1kHz sine wave?    A square wave has harmonics (although the 2kHz harmonic is less than the 1kHz fundamental).

Did you bias the input (so you don't clip the negative half of the waveform)?    A rectified wave will also contain harmonics although again, the harmonics should be less than the fundamental.

Quote
I want to make analyzer for sound messurement for health hearing i need analyze sound in octavband and determin dB in per band but first i should analize sound in octaband
I'm not sure how that's going to work...   Typically with a hearing test a single tone is played at a known frequency and known amplitude and the patient/subject presses a button or raises his/her hand when they hear a tone.

Since the frequency and amplitude are known, there is no need to "analyze" the sound.

It's straightforward, except the headphones/speakers have to be calibrated (for SPL level and frequency response) and you need a soundproof environment so that quiet tones are not drowned-out by background noise.    And, neither of those are trivial.

Quote
Your mean ardunio can not analize sound at least to 8000 hz?
There are two things that affect the maximum frequency -

1)  Nyquist theory says your sample rate has to be at least twice the signal frequency.  The easy way to think about it is that you need to sample the positive-half of the wave at least once per cycle and the negative-half at least once per cycle.  

If the signal is greater than half the sample rate you'll get aliasing (false frequencies).    

The signal has to be filtered before  it's digitized because the aliasing occurs when it's digitized and then it's too late to know.   Every soundcard has a low-pass anti-aliasing filter.

You can build a Arduino spectrum-analyzer display/effect without a filter, and you can get-away with it because the highest frequencies in normal voice/music are low level so the alias is low-level and it's only a visual effect so it doesn't have to be perfect.

2)  The Arduino ADC looses accuracy above a sample rate of 15kHz which limits you to 7500Hz for the full 10-bit accuracy.



Noisecontrol

What Arduino do you have?

In order to see 20KHz you need to sample at least at 40KHz and preferably much higher.

The project will require you know about FFT and windowing functions applied to the input waveform. I don't think it is something you can do with a Uno class Arduino.
I use uno

Grumpy_Mike

An aplication on android mobile can do analyize sound in octavband
Do arduino uno dont able it?
The processor chip in an Android phone is several orders of magnitude more powerful than a Uno and it has a lot more memory to store samples. What you want can't be done with any accuracy on a Uno.
What you want is a lot of development work, the code is not just hanging about ready for you to pick up.

I think this project is unfeasable for you given your current skill level and understand.

Noisecontrol

#22
May 30, 2018, 09:20 am Last Edit: May 30, 2018, 10:44 am by Noisecontrol
Last night did it of cource it may be have low perciton
First sampling changed to 9950 hz and sample to 128
It make 63 value frequency and then by a ton genrate determin lower and upper frequency in per band and then get average of all freqency that in per band and set that average value for central frequency
Now i have 6 bands
125
250
500
1000
2000
4000

Tonight i want to convert adc to dB by regression and then wieghted to dBA
It may be have some error but i must study it and see do have meaningful diffrence with dB of sound level meter or not


MarkT

An aplication on android mobile can do analyize sound in octavband
Do arduino uno dont able it?
I see some video in youtube that analize sound

An android phone has 3 to 4 orders of magnitude more processing power than an Uno...
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Noisecontrol

Which type ardiuno is suitable for sond analyiz
From 31 till 12000 Hz?

MarkT

#25
May 30, 2018, 04:25 pm Last Edit: May 30, 2018, 04:26 pm by MarkT
Well how much processing grunt do you need - what approach are you going with?  Certainly a 32 bit
Arduino would be a start, for FFT one with hardware floating point would be really good to have.

To implement digital filtering in fixed point doesn't require floating point, but 32 bit hardware multiply
operation is really good to have, as digital filtering is all multiply-and-add.

Have you looked for existing projects that might have tackled similar / same problem?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

DVDdoug



Quote
Which type ardiuno is suitable for sond analyiz
From 31 till 12000 Hz?
I'd suggest you start with a computer.  Then once you've got your concept working you'll have a better idea of what you need and what you can do.   But, it seems to me that you'll probably want to connect to a computer anyway.   A computer already has a soundcard, and assuming you have a laptop you've also got a microphone.

I don't have a good feel for how much processing power you need, but depending on how much resolution you need (both frequency and amplitude) you may need a computer or a specialized DSP chip.   People have made some nice spectrum analyzer effects with the Arduino, but you can't build a real audio spectrum analyzer with it.   A real spectrum analyzer is an expensive piece of equipment.   ...It' s question of how much precision/accuracy you need.

Audacity (free) can show you a spectrum so you can get started without any programming.   (Audacity will only show you a spectrum of a recording, so it doesn't work in real-time, but Audacity can record.)

Or you can find spectrum analyzer applications that do work in real-time, if that's what you want. 

Some people doing "serious" audio analysis use Matlab (or one of the free Matlab clones) rather than writing their own C/C++ code.

You can't run the same programs on a computer and the Arduino, but you can write C or C++ programs for either platform, and the same concepts, logic, and algorithms can be used.

Noisecontrol

I want to make a application when set in a noisy enviroment say leq(dBA)for 5 minut and show how much NRR for earplug or or ear muff need and how long time is allowable for work in that enviroment
I want to make a small application icant use computer or labtab cuz may cray of it is not possible

Noisecontrol

If be an android application that analize sound then send data to ardino by bluetooth or another way and then analyiz for show enviroment condation

Grumpy_Mike

Post #27 and you have finally condescended to tell us what it is all about. A great way to win friends.

Go Up