I will give you the equation for a filter along with MATLAB code that I have to implement the filtering in an algorithm.
I want a MATLAB programmer to give me a MATLAB script that will plot the impulse responses at different frequencies.?
## Deliverables
Attached is a word document that describes a filter.
I want to plot the impulse responses for the filter using matlab.
I want you to develop a matlab script that will plot the impulse responses of the filter. The matlab code that I have for the filter is given below, it may be a help to you?
% Dermot Campbell
% PEAQ ADVANCED VERSION
% Filter Bank Values
% Function called from FilterBank.m (Main Program)
% Impulse Length in Samples - used in Filters.m
N = [1456,1438,1406,1362,1308,1244,1176,1104,1030,956,884,814,748,686,626,570,520,472,430,390,354,320,290,262,238,214,194,176,158,144,130,118,106,96,86,78,70,64,58,52];
Data_in = [1,0,0,0,0,0,0,0,0,0,0];
num_fil = 40;
FS = 48000;
facAdv = (10^(92/20))/32767;
% Bark Lower Frequency
fl = 50; % fl is 50Hz, the lower cut-off freq
Bfl = 7*asinh(fl/650);
% Bark Upper Frequency
fu = 18000.02; % Upper Cut-off freq
Bfu = 7*asinh(fu/650);
% Spacing - Bark Scale Resolution
dzAdv = (Bfu - Bfl)/(num_fil-1);
fcAdv = zeros(num_fil,1);
zc = zeros(num_fil,1);
D = zeros(num_fil,1);
nsamp = length(Data_in);
HI1 = zeros(num_fil,max(N)); % Store the result after filtering.
HQ1 = zeros(num_fil,max(N)); % 90 degrees Phase Shift
XR = zeros(num_fil, nsamp);
XI = zeros(num_fil, nsamp);
for(k = 1:num_fil),
zc(k) = Bfl + (k-1)*dzAdv; % Centre Frequency in Bark
fcAdv(k) = 650*sinh(zc(k)/7); % Centre Frequency in Hertz
D(k) = 1 + 0.5*(N(1) - N(k)); % Additional Delay of each filter.
% calculate the impulse response of filter k
hp = (4/N(k))*((sin(pi*((0:N(k)-1)/N(k)))).^2); % Low Pass Prototype for k.
% modulate to frequency fc(k)
hreal = hp.*cos(2.*pi.*(fcAdv(k)/FS).*((0:N(k)-1)-(N(k)/2))); % real
himag = hp.*sin(2.*pi.*(fcAdv(k)/FS).*((0:N(k)-1)-(N(k)/2))); % imaginary - hilbert transform (90 degrees phase shift)
% do the filtering of the input signals
XR(k,:) = filter(hreal, 1, Data_in);
XI(k,:) = filter(himag, 1, Data_in);
end
% Decimation - downsample by 32
XR = XR(:,1:32:end);
XI = XI(:,1:32:end);