[b,a] = ellip(6,0.1,40,0.45);

% impulse response
x = [1,zeros(1,511)];
y = filter(b,a,x);

% frequency response
[h,w] = freqz(b,a,512);

figure(1);
subplot(2,1,1);
plot(y);
legend('Impulse Response');
xlabel('Time in Samples');
ylabel('Amplitude');
subplot(2,1,2);
plot(w/pi,20*log10(abs(h)));
legend('Frequency Response');
xlabel('Normalized Frequency');
ylabel('Log Amplitude (dB)');
figure(2);
zplane(b,a);

% filter 16kHz waveforms
[x1, fs, nbits] = wavread('00000005_16kHz.wav');
y1 = filter(b,a,x1);
wavwrite(y1,fs,'00000005_l6kHz_iir.wav');
