Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to demonstrate aliasing with music files?

1 view
Skip to first unread message

Mark Krug

unread,
Jun 27, 2008, 2:56:03 AM6/27/08
to
Hi,
I want to demonstrate the aliasing effect on real music, not
only a sinus signal, here is what I've tried:

[data,fs1,nBits]=wavread('beatbox.wav');
data2=downsample(data,3);
data2= data2(1:length(data2));
data3=interp(data2,3);
wavplay(data3,fs1);


But the result still sounds like the original track.
Maybe the first function doesn't break the Nyquist-Theorem
so I decided to downsample again

[data,fs1,nBits]=wavread('beatbox.wav');
data2=downsample(data,2);
data2=downsample(data2,2);
data2=downsample(data2,2);
data2= data2(1:length(data2));
data3=interp(data2,8);
wavplay(data3,fs1);


Now the result sounds more different to the original track,
but I think this still isn't the aliasing effect, does
anybody can help me with that??

Thank you.

Andor

unread,
Jun 27, 2008, 5:44:27 AM6/27/08
to
Mark Krug wrote:
> Hi,
> I want to demonstrate the aliasing effect on real music, not
> only a sinus signal, here is what I've tried:
>
> [data,fs1,nBits]=wavread('beatbox.wav');
> data2=downsample(data,3);
> data2= data2(1:length(data2));
> data3=interp(data2,3);
> wavplay(data3,fs1);  
>
> But the result still sounds like the original track.
> Maybe the first function doesn't break the Nyquist-Theorem
> so I decided to downsample again

To hear aliasing, your input signal 'beatbox.wav' must have high-
frequency components. There is Matlab code available to reconstruct
missing samples under the assumption of bandlimited-ness. You can
download it from here:

http://apollo.ee.columbia.edu/spm/?i=external/tipsandtricks

(The download file for the article "Recovering Periodically-Spaced
Missing Samples".)

First load your data:
[data,fs1,nBits]=wavread('beatbox.wav');

Then clear some samples (for example, delete two out of three
samples):
data(2:3:end) = 0;
data(3:3:end) = 0;

Look at the "demorecons.m" file how to reconstruct the data under the
assumption that it was bandlimited to Fs/6. If the data wasn't
bandlimited, then the high frequency components will appear as
aliasing artefacts:

Calculate reconstruction filterbank:
tpind = [1 0 0]; % this indicates two out of three missing
samples
N = 101; K = (N-1)/2; % N (odd) is the size of the reconstruction
filter
h = interpfbank(tpind,K); % h is the reconstruction filter bank

Now replace the zero sampled values such that the resulting signal is
bandlimited to Fs/6:
aliased_data = recons(data,tpind,h);

You can also delete a higher percentage of samples to increase the
aliasing artefacts.

Regards,
Andor

0 new messages