Does audiowrite have an anti-aliasing filter?

2 views (last 30 days)
Cecilia
Cecilia on 3 May 2017
Edited: Jan on 3 May 2017
Hi all,
I have created a sinusoid s1 with frequency 1000 Hz as following:
f = 1000;
Fs1 = 44100;
Ts1 = 1/44100;
t1 = 0:Ts1:1;
s1 = sin(2*pi*f*t1);
I can play it and save it as a .wav file as following at it works.
soundsc(s1, Fs1)
audiowrite('Original_1000Hz.wav',s1,Fs1)
Now I want to create an aliased frequency (for education purposes) and do the same, showing that the frequency is different. soundsc plays indeed the aliased frequency, but when I saved it with audiowrite and play it outside Matlab I will just hear silence.
Fs2 = 1500;
Ts2 = 1/Fs2;
t2 = 0:Ts2:1;
s2 = sin(2*pi*f*t2);
soundsc(s2, Fs2)
audiowrite('Aliased_500Hz.wav',s2,Fs2)
Why is that? Does audiowrite have an antialiasing filter or something like that? The interesting fact is that sounsc is correctly emitting sound at the right frequency.
Thanks!
Cecilia

Answers (1)

Jan
Jan on 3 May 2017
Edited: Jan on 3 May 2017
No, audiowrite does not modify the data. Otherwise you would find this detail in the docs. Consider that something else goes wrong, perhaps you are writing to a different folder than you think you do. Or the method " play it outside Matlab" is broken: Perhaps you hit the "mute" button of the software?
  1 Comment
Cecilia
Cecilia on 3 May 2017
Thanks for your answer Jan, I am writing in the right folder. The new .wav file is indeed there, but I can just here silence. It should be something related to the sample rate, as the same procedure works with a 44.1 kHz sample rate as I explained in the first part.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!