Skip to content

Instantly share code, notes, and snippets.

@arthurafarias
Last active March 29, 2016 03:02
Show Gist options
  • Save arthurafarias/7dcd0ed209df5673e09a to your computer and use it in GitHub Desktop.
Save arthurafarias/7dcd0ed209df5673e09a to your computer and use it in GitHub Desktop.
UFCG - EE - LPC - P03 Q01
h = @(n,wc,ws) 2*wc/ws*sinc(n*2*wc/ws); % impulse response of a lowpass filter in discrete domain, ws sampling angular frequency, wc cutoff frequency
h_causal = @(n,wc,ws,N) h(n-(N-1)/2,wc,ws); % causal version of impulse response
N = 33; % given in question
wc = 2*pi*500; % given in question
ws = 2*pi*8000; % given in question
i = 0:(N-1); % indexer, vector length is N-1.
bi = h_causal(i,wc,ws,length(i)); % FIR gains
@arthurafarias
Copy link
Author

to run this gist on matlab just copy and paste following code into matlab console.

eval(urlread('https://gist.githubusercontent.com/arthurafarias/7dcd0ed209df5673e09a/raw/e3607c4f7d2bf2362ff3f1f40ff6e5784ae326aa/ufcg-ee-lpc-p03q01.m'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment