Skip to content

Instantly share code, notes, and snippets.

@FelipeCortez
Created March 15, 2017 11:49
Show Gist options
  • Save FelipeCortez/379fecea99a5d75e0a9956000446d2c4 to your computer and use it in GitHub Desktop.
Save FelipeCortez/379fecea99a5d75e0a9956000446d2c4 to your computer and use it in GitHub Desktop.
Filtering
function [] = pre1()
clf()
x = [1, zeros(1,99)]
y = filter([1], [1, 0.95], x)
plot2d3(y)
endfunction
function [] = pre2()
clf()
h = iir(10, 'lp', 'butt', 0.125, [0 0])
B = coeff(h(2))
B = B(11:-1:1)
A = coeff(h(3))
A = A(11:-1:1)
[hzm, fr] = frmag(B, A, 512)
plot2d3(fr * 8000, abs(hzm))
endfunction
function [] = pre3()
clf()
h = iir(10, 'lp', 'butt', 0.125, [0 0])
B = coeff(h(2))
B = B(11:-1:1)
A = coeff(h(3))
A = A(11:-1:1)
[hzm, fr] = frmag(B, A, 512)
x = [1, zeros(1, 49)]
y = filter(B, A, x)
plot2d3(y)
endfunction
function [] = ex1()
t = [0:1/8000:8191/8000]
x = sin(2 * %pi * 100 * t + 2 * pi * 100 * (t .* t)
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment