Electronic – Custom WAVE file results in different sound profile than created

audiofunction generatorsound

My problem is as following:

I'm trying to use my sound card to produce a custom repeating wave pattern which I will use in some laboratory test setup. My curve is based on a combination of a couple of sin/cos functions which I got from a Fourrier Analysis. I created an .WAV audiofile of this repeating pattern and try to play it from my sound card.

However when I record the audioprofile which my laptop is outputting it looks different.

Does anyone know why this is happening? and how to solve this problem?

Original audioprofile:
correct wave pathern

Output from sound card:
output from sound card

Best Answer

A soundcard has a low frequency limit - this is created by a high pass filter of around 10Hz to 20Hz. This is what is disrupting your signal. For signals below 20Hz the output from the sound card is going to become progressively smaller and smaller.

Humans can't really hear below 20Hz so that is a technical reason for sound cards "not bothering" to reproduce frequencies of a few hertz. Another reason is that a big sub-bass signal could likely destroy cheap computer speakers without this sort of filtering being implemented.

Here is a frequency response for a typical soundcard: -

enter image description here

This was taken from this site. Note how the vertical axis is nominally centred around 0 - I take this to mean 0dB - note that at 30Hz, the response is down by 2 dB and at much lower frequencies there is going to be severe attenuation.

At 1.8 Hz I don' think you will adequately recover anything that useful but, you could try creating a low pass filter to "counter" the effects of the in-built high pass filter. Alternatively buy a professional card that can reproduce DC.

What I'd do as an experiment: -

Get a free version of a simulator such as LTSpice. Create a custom waveform to match your designed waveshape (in that software) and input it to a high pass filter (like in your sound card). Tweak until you are happy it looks like the actual sound card output. Then I'd try and design a "counteracting" low pass filter based around maybe a couple of op-amps and see if the original waveform could be reasonably restored.

If happy with the restoration I'd build the op-amp circuit and fingers crossed it should be OK.

Alternatively I'd over-egg the original waveform to try and boost the lower frequencies much more (pre-emphasis) to see how that would look after the sound card mangles it.