Skip to content

Instantly share code, notes, and snippets.

@caiorss
Forked from GiovanniBalestrieri/.m
Created December 25, 2016 22:37
Show Gist options
  • Save caiorss/e8fee534d1f2a78598be221be8d5f2cb to your computer and use it in GitHub Desktop.
Save caiorss/e8fee534d1f2a78598be221be8d5f2cb to your computer and use it in GitHub Desktop.
Snippet - Basic Matlab Filter
%% Filter Design
% Designs a second order filter using a butterworth design guidelines
[b a] = butter(2,0.2,'high');
% Plot the frequency response (normalized frequency)
figure(3)
H = freqz(b,a,floor(num_bins/2));
plot(0:1/(num_bins/2 -1):1, abs(H), 'r');
hold on
grid on
plot(0:1/(num_bins/2 -1):1,X_magsNorm(1:num_bins/2),'g')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment