# Why does the standard waveform from audio out get distorted when I reduce the amplitude?

In my attempt to generate a standard sine wave out of a sound card, I started using matlab which has a function soundsc for scaling the output

 t = 0:1/48000:10;
y = sin(1000*2*pi*t);
soundsc(y,48000,[a b]);


It's ok when my a and b are -1 and 1 respectively. When I try to make them even -0.9 and 0.9 respectively, the standard sine wave of 1Khz gets distorted, why?

Are our sound cards not able to handle standard sounds?

## 1 Answer

Primarily because the documentation is poorly written. If you want to play at half amplitude you need to use

soundsc(y,48000,[-2 2]);


The range argument is the input amplitude range that gets mapped to the maximum available range of the sound card. So if the max of your input exceeds the max in the range argument, you will get clipping.

• so you mean to say that if i want the waveform [-0.5 0.5] i have to make it [-2 2] assuming sound card limits are [-1 1], but on the other side documentation says [-1 1] are the min and max limits, can you elaborate a bit, thanks – kakeh Jul 27 '15 at 12:00
• mathworks.com/help/matlab/ref/soundsc.html – Hilmar Jul 27 '15 at 21:58
• if you observe the documentation it clearly says it depends on the sound card what are your max and min limits, what ever the limits may be the matlab would scale them to [-1 1] boundaries, and its true i also observe it, what is the point you are trying to make ? – kakeh Jul 28 '15 at 1:15