I am working on a project that essentially would be used to measure the Noise produced by ceiling fans and regulate the speed if the noise interferes with speech levels.

For the first phase of this project I have to sense the noise levels. I have used an Electret Microphone Amplifier MAX4466 to detect the sound and have written a sketch in arduino to measure peak-to-peak amplitude and calculate the voltage. I am looking to provide this signal as in input an a-weighting filter (attached as example.m) on MATLAB. I have downloaded the MATLAB Arduino support package. I somehow can't figure out how to incorporate the analog output of the mic-amp into the matlab a-weighting code.

i'll attach the code (example.m) for reference. (it's an open source code for a generic A-weighting filter response with AWGN )

http://www.mathworks.com/matlabcentral/answers/uploaded_files/46634/example.m http://www.mathworks.com/matlabcentral/answers/uploaded_files/46633/filterA.m

If there are any suggestions as to a better or different technique to solve this problem, I would appreciate that too.

  • \$\begingroup\$ How do you intend to get the signal into the PC for Matlab to handle it? \$\endgroup\$ – JRE Mar 3 '16 at 10:27
  • \$\begingroup\$ Hi, I have interfaced my Mic-amp with Arduino and have MATLAB-Arduino Support packages. I just want to know how I can Take the signal from my analog output and use it as the input for my a-weighting filter. \$\endgroup\$ – Shruti M. Mar 3 '16 at 10:41
  • \$\begingroup\$ How do you detect that the noise interferes with speech levels? How can you understand speech levels by measuring fan noise? How do you prevent the massive signal of fairly sub sonic air movement (caused by the fans) from saturating the signal of the microphone? \$\endgroup\$ – Andy aka Mar 3 '16 at 10:45
  • \$\begingroup\$ @Andyaka : that is the next stage. IF the noise made by the ceiling fans, is above 60 db SPL it is not good for a listening environment in classrooms and then some action will be triggered. However right now, I wish to integrate the signal into MATLAB to pass it through an a-weighting filter. so that I have spl levels in db(A) as well as a plot of the noise. Any advise? \$\endgroup\$ – Shruti M. Mar 3 '16 at 10:48
  • \$\begingroup\$ and, @Andyaka .. the issue of ceiling fans is only an application which I intend to work on. Basically I also want accurate noise level measurements and a noise map to be used for a variety of applications. \$\endgroup\$ – Shruti M. Mar 3 '16 at 10:50

You cannot perform the A-weighting on your peak-peak measurement.

You would need to feed the raw audio into Matlab to do that. Or more practically, design a filter to perform the A-weighting in the analog domain, between the Mic Amp and the Arduino.

  • \$\begingroup\$ hi, thanks. The question now is, how to I feed the signal from my mic-amp into matlab a-weighting filter code? \$\endgroup\$ – Shruti M. Mar 4 '16 at 10:20
  • \$\begingroup\$ Digitise the raw audio, find a fast enough way to get it into the PC, and hope that Matlab can keep up. The obvious way would be to ignore the Arduino and use the PC's own soundcard (mic/line in) but that raises gain/calibration issues you don't need. If you want to use the Arduino you need a link that can handle (bytes/sample) * (sample rate) * (no. of channels) from Arduino to PC ... good luck. \$\endgroup\$ – Brian Drummond Mar 4 '16 at 12:16
  • \$\begingroup\$ Thank you. Will try my luck with the arduino otherwise will shift to the PC Soundcard for now. \$\endgroup\$ – Shruti M. Mar 7 '16 at 6:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.