Hello, I am trying to store sound wave using analog mic using stm32f4 discovery board. external mic--> adc-->dac-->codec--->headphone.
When I am trying to play recorded sound using codec, I am not able to hear recorded sound . can any one help me?
you wrote >> external mic--> adc-->dac-->codec--->headphone
I undertsand here that you want to hear the mic's captured sound (not a stored sound)
Supposing that "dac" means the MCU's internal DAC.
To hear the sound , headphone must connected to DAC output and the sequence is mic--> adc-->dac-->headphone
In case "dac" means the CS43L22 DAC, the sequence could be be mic--> adc-->PCM coder -> I2s -> dac-->headphone(black socket)
In this case needs also I2C interface to control the DAC.
There are examples how to use CS43L22 DAC at this page related to your board.
thank you for your response.Now it's working but noise is also coming. so how can I remove this noise?
>>> "noise is also coming"
Noise can be produced from
Analog cirquitry from your microphone.
Interference from digital cirquitry
Mic adaptation to ADC. Means differend mic's output voltage range than ADC's input range, leading to poor quality samples.(biased low bit depth samples)
Collecting and processing the data .(low sample rate, low bit depth, DSP integer mathematics, etc)
Noise can removed by first locating the source. A spectrum analyser could help you a lot.
Due to codec, some noise is coming. When I am not connecting the external mic. what can be the reason and how can I remove this noise?
>>>Due to codec, some noise is coming.
Its normal to have some noise from codecs especialy voice codecs.
When external mic is not connected to stm32f4 board,I am getting 5.4khz,4.5khz and 2.5khz frequency component from my codec. how I can remove this noise? (This noise is due to analog pass-through).
external mic --> onboard ADC -->LPF-->DAC--> codec(analog pass through )-->headphone
What you mean , not connected? just removed or the ADC input is connected to ground?
In first case , is enough to ground the ADC input (or your amplifier input).
In second case, means that although ADC samples taken are zeroes , the LPF produces noise.
I dont know what kind of LPF you use.
What is your desired cutting frequency? Consider that Fcut can't be more than about SamplingRate/2
I have connected ADC pin to ground but 5.4khz,4,5khz and 2.5khz frequency component is present in my output.
sampling frequency=48khz, and different cutoff frequency coefficient I have used, but noise is present.
I am using CMSIS lib function for LPF (arm_fir_f32) . I have generated frequency coefficient using matlab.
cutoff frequency that I have used are 1khz,2,khz,3khz,4khz and 5khz.but there is no change in my output.
I got the solution. Now, frequency component is removed.Thanks for the help.
Try generating tones by using a sine-table, and confirm if you issues with playback or recording.
Retrieving data ...