Conv Demo
Conv Demo
Conv Demo
Max Kamenetsky
In this demo you'll listen to a 10 second segment of music, alternating with various ltered
versions of it. You should try to relate what you hear to the frequency response, impulse
and step responses, and snapshots of the input and output signals.
!c
s + !c
1 + s=!c
where !c = 2 1000.
Note that it passes frequencies under around 500Hz or so, but attenuates high frequencies.
Since it attenuates high frequencies the ltered segment will sound a bit mued. (A higher
order lowpass lter, with a sharper cuto characteristic, would sound much more mued.)
The impulse response shows that this lter smooths out the input, giving a sort of averaging
over a few milliseconds. You can see that the ltered signal is a smoothed version of the
original signal.
1pole lowpass (Fc = 1kHz) Bode plot
Magnitude (dB)
5
10
15
20
25
2
10
10
Frequency (Hz)
10
10
Phase (deg)
20
30
40
50
60
70
80
2
10
10
Frequency (Hz)
10
Amplitude
5000
4000
3000
2000
1000
0
Time (s)
x 10
Amplitude
0.8
0.6
0.4
0.2
0
Time (s)
x 10
Original signal
0.04
Amplitude
0.02
0.02
0.04
0.5
1.5
2.5
Time (s)
3.5
4.5
3
x 10
Amplitude
0.02
0.02
0.04
0.5
1.5
2.5
Time (s)
3.5
4.5
3
x 10
s + !c
s=!c
1 + s=!c
where !c = 2 1000.
This transfer function attenuates low frequencies, but lets frequencies above 2kHz or so
pass. You can hear that the bass is quite reduced. You can also see from the signal waveforms
that the fast wiggles in the signal come through, but the slower variations are quite reduced.
1pole highpass (Fc = 1kHz) Bode plot
Magnitude (dB)
5
10
15
20
25
30
2
10
10
Frequency (Hz)
10
80
Phase (deg)
70
60
50
40
30
20
10
2
10
10
Frequency (Hz)
10
Amplitude
2000
(t)
0
2000
4000
6000
1
4
Time (s)
9
4
x 10
Amplitude
0.8
0.6
0.4
0.2
0
1
4
Time (s)
9
4
x 10
Original signal
0.04
Amplitude
0.02
0.02
0.04
0.5
1.5
2.5
Time (s)
3.5
4.5
3
x 10
Amplitude
0.02
0.02
0.04
0.5
1.5
2.5
Time (s)
3.5
4.5
3
x 10
Magnitude (dB)
10
0
10
20
10
10
Frequency (Hz)
10
Phase (deg)
50
50
10
10
Frequency (Hz)
10
Amplitude
5000
5000
0
0.001
0.002
0.003
0.004
0.005
Time (s)
0.006
0.007
0.008
0.009
0.01
0.009
0.01
Amplitude
1
0.5
0
0.5
0.001
0.002
0.003
0.004
0.005
Time (s)
0.006
0.007
0.008
3.5
Original signal
0.04
Amplitude
0.02
0.02
0.04
0.5
1.5
2.5
Time (s)
4.5
3
x 10
Amplitude
0.02
0.02
0.04
0.5
1.5
2.5
Time (s)
3.5
4.5
3
x 10
=K
(Q=!c) + s + Q!c
s2
Magnitude (dB)
20
10
0
10
20
30
2
10
10
Frequency (Hz)
10
Phase (deg)
50
50
10
10
Frequency (Hz)
10
Amplitude
2000
2000
4000
0
0.001
0.002
0.003
0.004
0.005
Time (s)
0.006
0.007
0.008
0.009
0.01
0.009
0.01
Amplitude
0.4
0.2
0
0.2
0.4
0.6
0
0.001
0.002
0.003
0.004
0.005
Time (s)
0.006
0.007
0.008
3.5
Original signal
0.04
Amplitude
0.02
0.02
0.04
0.5
1.5
2.5
Time (s)
4.5
3
x 10
Amplitude
0.02
0.02
0.04
0.5
1.5
2.5
Time (s)
3.5
4.5
3
x 10
Allpass lter
First order allpass lter with 90 phase shift at 1kHz. Transfer function:
H (s)
!c
s + !c
1
;
s=!c + 1
s=!c
where !c = 2 1000.
This lter passes all frequencies with unity gain. It does, however, shift the phase of the
signal.
You really can't hear any dierence at all, since the ear is pretty insensitive to (moderate)
phase shift. The ltered signal looks quite a bit like the original signal, but is not the same.
First order allpass Bode plot
Magnitude (dB)
10
10
Frequency (Hz)
10
160
Phase (deg)
140
120
100
80
60
40
20
2
10
10
Frequency (Hz)
10
(t)
2000
Amplitude
0
2000
4000
6000
8000
10000
12000
1
4
5
Time (s)
9
4
x 10
Amplitude
0.5
0.5
1
1
4
5
Time (s)
9
4
x 10
Original signal
0.04
Amplitude
0.02
0.02
0.04
0.5
1.5
2.5
Time (s)
3.5
4.5
3
x 10
Amplitude
0.02
0.02
0.04
0.5
1.5
2.5
Time (s)
10
3.5
4.5
3
x 10
K (1=0:1);
0;
0 t < 0:01
t 0:01
The DC gain is K , which we take to be K = 3:5 10:9dB to increase the volume level.
In this case the ltered signal output is exactly (K times the) average of the input signal
over the last 10ms. Here the ltered signal sounds very mued; the high frequencies are
strongly attenuated.
10 ms moving average Bode plot
Magnitude (dB)
20
40
60
80
100
10
10
Frequency (Hz)
11
10
10
x 10
8
Amplitude
6
4
2
0
2
0.005
0.01
0.015
0.02
0.025
0.02
0.025
Time (s)
10 ms moving average step response
4
Amplitude
0
0
0.005
0.01
0.015
Time (s)
Original signal
Amplitude
0.05
0.05
0.5
1.5
Amplitude
2.5
Time (s)
3.5
4.5
3
x 10
x 10
0.5
1.5
2.5
Time (s)
12
3.5
4.5
3
x 10
(t) + 0:75 (t
0:4098 (t
0:2804 (t
This represents 8 perfect echos. The rst one arrives 125ms after the rst impulse, and
the others come over the next 125ms or so.
Hall echos Bode plot
10
Magnitude (dB)
10
15
20
25
30
10
10
Frequency (Hz)
13
10
Amplitude
2
1.5
1
0.5
0
0.5
0.1
0.2
0.3
Time (s)
0.4
0.5
0.6
0.4
0.5
0.6
Amplitude
2
1.5
1
0.5
0
0.5
0.1
0.2
0.3
Time (s)
Original signal
Amplitude
0.2
0.2
0.227
0.2275
0.228
0.2285
0.229
0.2295
Time (s)
0.23
0.2305
0.231
0.2315
0.23
0.2305
0.231
0.2315
Amplitude
0.2
0.2
0.227
0.2275
0.228
0.2285
0.229
0.2295
Time (s)
14