Skip to content

Instantly share code, notes, and snippets.

@WillNilges
Created March 11, 2022 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillNilges/cc12fb32f16ca808a095d235ab582e41 to your computer and use it in GitHub Desktop.
Save WillNilges/cc12fb32f16ca808a095d235ab582e41 to your computer and use it in GitHub Desktop.
Matlab is a bad product that doesn't function.
bb=[1,-2,2,-1]; %filter coefficients
ww=linspace(-1,1,250); % frequency grid (normalized)
HH = freqz(bb,1,ww*pi); % frequency response
% Show results in one figure
subplot(211); % select top subfigure
plot(ww,abs(HH)); % generate plot
ylabel('Magnitude') % y axis label
xlabel('Freq [\times \pi]') % x axis label
grid % this adds a grid
subplot(212); % select top subfigure
plot(ww,angle(HH));
ylabel('Phase [radians]')
xlabel('Freq [\times \pi]')
grid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment