E C E 431 Lecture Notes - Lecture 2: Spectrogram

17 views6 pages
ECE 431 Period 2
Contents
Set up Workspace
Problem 1
Set up Workspace
close all
clear
Problem 1
a) max freq without aliasing = 22.05 kHz
b) max freq without aliasing = 1378 Hz
c) Decreasing the sampling rate by a factor of 16 ends up removing a lot of high frequency content, so the piece sounds much
"duller".
d) The effect of aliasing appears most pronounced at the end of the piece (> 10 sec) and is greater in the higher frequencies
(say > 500 Hz).
e) You can hear the distortion towards the end of the piece in the higher frequency notes as predicted by the spectrogram.
f) The waveforms with and without aliasing are also different visually.
[Egmont,fs] = audioread('EgmontOverFin.wav');
sound(Egmont,fs) % Original
pause
T = 1/fs;
noAliasSong = resample(Egmont,1,16);
sound(noAliasSong,fs/16) % Downsampled by 16 w/o aliasing
pause % hit any key with cursor in the command window to continue
AliasSong = Egmont(1:16:end,:); % discard samples without LP filtering
sound(AliasSong,fs/16) % Downsampled by 16 w aliasing
figure
spectrogram(noAliasSong(:,1),512,128,2048,fs/16,'yaxis')
title('Spectrogram with no aliasing')
figure
spectrogram(AliasSong(:,1),512,128,2048,fs/16,'yaxis')
title('Spectrogram with aliasing')
t = [0:16:length(Egmont)-1]*T;
figure
Unlock document

This preview shows pages 1-2 of the document.
Unlock all 6 pages and 3 million more documents.

Already have an account? Log in
plot(t,noAliasSong(:,1),'b',t,AliasSong(:,1),'r') % Select one channel
xlim([14,14.02]) % select 20 ms time interval
xlabel('Time (s)')
ylabel('Amplitude')
legend('No Aliasing','With Aliasing')
Unlock document

This preview shows pages 1-2 of the document.
Unlock all 6 pages and 3 million more documents.

Already have an account? Log in

Get OneClass Notes+

Unlimited access to class notes and textbook notes.

YearlyBest Value
75% OFF
$8 USD/m
Monthly
$30 USD/m
You will be charged $96 USD upfront and auto renewed at the end of each cycle. You may cancel anytime under Payment Settings. For more information, see our Terms and Privacy.
Payments are encrypted using 256-bit SSL. Powered by Stripe.