Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Homework 7
- % ECE107
- % What do you call a music school's admissions?
- % A BANDPASS filter.
- %% Problem 1 (First Attempt)
- o = -pi:0.00001:pi;
- t = -pi:0.00001:pi;
- nl = 0.4.*pi;
- nu = 0.5.*pi;
- narrow_ass = 2.*(nl-nu).*sinc((nl-nu).*t).*cos( o .* t );
- %narrow_ass = (0.797885.*exp(-0.45.*i.*t) .*(1 + exp(0.9.*i)).*sin(0.05.*t))./t;
- figure(1);
- plot(t,narrow_ass);
- title('Narrow Assignment Filter');
- wl = 0.3.*pi;
- wu = 0.7.*pi;
- wide_ass = 2.*(wl-wu).*sinc((wl-wu).*t).*cos( o .* t );
- figure(2);
- plot(t,wide_ass);
- title('Wideband Assignment Filter');
- %% Problem 1 (Second Attempt)
- %
- % nl = 0.4.*pi;
- % nu = 0.5.*pi;
- % LUV = (nu-nl)./2; % Lower Upper aVerage
- % MUV = (nu-nl); % Difference of the two
- % t = -pi:0.00001:pi;
- %
- % narrow_ass = exp(2.*pi.*j.*-LUV.*t)./(MUV) .* sinc( (t - (-LUV) ) ./MUV ) + exp(2.*pi.*j.*LUV.*t)./(MUV) .* sinc( (t - (LUV) ) ./MUV );
- %
- % figure(1);
- % plot(t,narrow_ass);
- % title('Narrow Assignment Filter');
- %% Problem 2
- % Make a windowed filtered etc.
- N = 1;
- Wn = [0.4 0.5];
- Nw = 25;
- w_vista = fir1((2*Nw),Wn,'bandpass',rectwin(2.*Nw+1));
- figure(3);
- plot(w_vista);
- title('Bandpass frequency');
- %for n = 1:Nw;
- disp('The DTFT of this... a little bit more difficult...');
- disp('It needs to be the summation of this function over the interval -NW to NW');
- %
- %for n = 1:Nw;
- % for o = -pi:pi;
- % dtft_vista(n) = w_vista.*(cos(o.*n) - j.*sin(o.*n));
- % end
- %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement