audioplayer function: clicks during playback of sine waves
Show older comments
I'm using audioplayer to generate sound from a series of sine waves (~200 - 500 Hz). My sample rate is 2KHz and each wave is played for 500ms. I'm presenting 16 waves, in series. However, the playback is riddled with audible clicks. These are not at the transition points between each consecutive wave. If I play the wave series (x) directly using 'sound(x, 2000)', I get no clicks. If I write the sounds to a .wav file, I get no clicks and the waveform looks clean in a sound file editor. The clicks are independent of output device also.
Accepted Answer
More Answers (1)
Daniel Shub
on 15 Jun 2012
0 votes
That is because MATLAB sound support is essentially broken. Look for some of the answer on the site referring to port audio.
Also note that with a 2KHz sample rate you are going to get aliasing.
1 Comment
Walter Roberson
on 15 Jun 2012
Why would there be aliasing when the sample rate is at least 4 times the frequency? I would expect aliasing if the sample rate was not at least twice the frequency?
Categories
Find more on Measurements and Spatial Audio in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!