I am working on Active Noise Cancellation Project. I came across a problem, where the signal is getting attenuated as the audio bit depth changes from PC data to Microcontroller and I cannot understand it!
My circutit :I connected Audio Output(Head phones) of PC[which is supposed to be analog signal] to Audio IN of NI myRIO 1900 device using AUX cable (two way 3.5mm jack cable). I have a pre-recorded signal(.wav) of sinusoidal waveform with Amplitude 1, Frequency 2kHz, 40000 Sample Rate, 80 Number of Samples, Bit depth( bits per sample) = 16.
Now, I just played .wav file using windows media player and tried to record the waveform on NI myRIO module. Surprisingly, I am getting an attenuation of the signal corresponding to the volume reduction in PC(not linear!!). Only I can see the waveform in microcontroller close to amplitude 1, when I increased the volume of the system to 100%. Please explain this !!
The ADC of NI myRIO has its Resolution as 12 bits but the audio Output(.wav file) is 16 bit data. I am expecting it does not have to matter except in quantization errors, as at the PC Audio Out, the audio data should be converted to analog and and again at the 'NI myRIO Audio In', this analog signal will be sampled! (please correct me if I am wrong !)
Another question is, I have tried the same with sinusoidal sound of Amplitude 2.5, now the audio signal is clipped off at 1V above and below -1V.
ADC(NI myRIO) nominal range is 2.499V to -2.5V! Is it bacause of the bit depth conversion?
Please explain these things !TQ
EDIT: I am not converting either 16 bit digital data to 12 bit digital data neither 12 to 16 !! I happen to have a 16 bit audio data, when I played this through windows media player will get converted to analog signal at head phones terminal, and I am feeding this ANALOG Signal to an ADC of NI myRIO, which has 12 bit resolution.