简体   繁体   中英

MATLAB audioplayer causing a chirp signal to have 'clicks'

I am creating a 'chirp' signal in MATLAB, using the following command.

Fs = 22050;
dt = 1/Fs;
tmax = 10;

t= 0:dt:tmax;                       % 10 second @ 22.5kHz sample rate
f0=50;f1=1000;                      % Start at 50Hz, go up to 1kHz
audio = chirp(t,f0,tmax,f1);

When I play the audio signal using the audio player in MATLAB, I hear periodic 'clicks'.

p = audioplayer(audio, Fs);
play(p)

Is it a problem with generation of the chirp signal or the playback?

I don't really need the playback to be perfect, just want to ensure that the chirp is fine and doesn't have the 'clicks' in the data.

For what its worth, I too got the clicks (about 5-6 of them, spaced evenly). I'm running OS X 10.6 MBP (2008) and MATLAB R1010b. However, I think the issue is hardware related (and annoying. I didn't know my sound card had issues) as several other got it to run cleanly.

As for the quality of your chirp signal, there's nothing wrong with it. The frequency spectrum and the spectrogram come out clean, and if the clicks were due to the signal, you'd see sharp peaks and significant contributions beyond 1000Hz.

Frequency spectrum

在此处输入图片说明

Spectrogram 在此处输入图片说明

(dynamic range is 140 dB)

I see to potential issues:

  • the signal is not properly normalized when replayed by you machine, it clips at MAX16 which ever the format used to save the signal to be replayed.

  • the signal has some sharp discontinuity which when looped introduced the annoying click. Typically between the end value and the first one of the signal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM