0% found this document useful (0 votes)
27 views

Audio Processing Using Matlab: Elena Grassi

This document discusses audio processing techniques in Matlab, including sampling, spectrograms, analog-to-digital and digital-to-analog conversion, aliasing, and filters. It covers key concepts such as sampling frequency, spectrogram tradeoffs between frequency and time resolution, anti-aliasing filters to prevent signal distortion from undersampling, different types of filters classified by their passbands and roll-offs, and relationships between filter order, complexity, and roll-off steepness.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Audio Processing Using Matlab: Elena Grassi

This document discusses audio processing techniques in Matlab, including sampling, spectrograms, analog-to-digital and digital-to-analog conversion, aliasing, and filters. It covers key concepts such as sampling frequency, spectrogram tradeoffs between frequency and time resolution, anti-aliasing filters to prevent signal distortion from undersampling, different types of filters classified by their passbands and roll-offs, and relationships between filter order, complexity, and roll-off steepness.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 12

Audio processing using Matlab

Elena Grassi

Sampling
Read values from a continuous signal
Equally spaced time interval (sampling frequency)
A/D (analog in/digital out)
AI = analoginput('winsound');
addchannel(AI,1);
set(AI,'SampleRate',44100)
set(AI,'SamplesPerTrigger',4*44100)
set(AI,'TriggerType','Manual')
start(AI)
trigger(AI)
data = getdata(AI);
delete(AI), clear AI

Spectrogram
Short time Fourier transform
Tradeoff frequency/time resolution.




Note: dB= 20*log10 ()
specgram(y, 256, fs)
title('Spectrogram [dB]')
D/A (digital in/analog out)
AO = analogoutput('winsound');
addchannel(AO,1);
set(AO,'SampleRate',22050)
set(AO,'TriggerType','Manual')
putdata(AO,x)
start(AO)
trigger(AO)
waittilstop(AO,5)
delete(AO), clear AO
Aliasing
When sampling is too slow for a signals
BW, high frequency content cannot be
observed and it leaks into lower
frequencies, thus distorting the signal.
Minimum sampling required to capture the
signal accurately:
Nyquist frequency= 2*BW
If not possible, apply antialiasing filter.

Filters
Modify frequency content of signals.
Classification according to their pass/stop bands:
Lowpass (smoothing filter)
Highpass
Bandpass
Stopband
Specify corner frequency(ies), normalized wrt
sampling frequency. Example: 2000/(fs/2) for
2000 Hz.

Example
0 2000 4000 6000 8000 10000 12000
0
1
2
3
4
5
6
7
f [Hz]
signal
LP filter
Filter Types
Classification according to their roll-off, flatness,
phase:
Bessel: linear phase, preserves wave shape.
Butterworth: flat and monotonic, sacrifice roll-off
steepness.
Chebyshev I: equiripple in passband and
monotonic in stopband.
Chebyshev II: monotonic in passband and
equiripple in stopband, roll off slower than type I.


Example
[b,a]= butter(6,2000*2/fsi,'low');
b= numerator polynomial in z
a= denominator polynomial in z

order
corner freq
sampling freq
Filter frequency response
h= impz(b,a,N);
H=(abs(fft(h)));
fscale= fsi/N*(1:N/2);
plot(fscale,H(1:N/2),'r')
xlabel('f [Hz]')
title('Filter frequency response')

Filter order
Related to complexity (hardware or
numerical) and how many samples of data
are used.
Higher order <-> Steepness
Trade off with complexity/numerical
stability

You might also like