Skip to content

Instantly share code, notes, and snippets.

@GiovanniBalestrieri
Created August 4, 2015 13:12
Show Gist options
  • Save GiovanniBalestrieri/24d9c5d4cbd69af2e0e2 to your computer and use it in GitHub Desktop.
Save GiovanniBalestrieri/24d9c5d4cbd69af2e0e2 to your computer and use it in GitHub Desktop.
Snippet - Basic Matlab Code
% Filters the signal using coefficients obtained by the butter filter
% design
x_filtered = filter(b,a,y);
% Plots the filtered signal
figure(4)
plot(t,x_filtered,'r')
hold on
plot(t,y0,'k','LineWidth',2)
hold on
plot(t,15,'k','LineWidth',2)
grid on
title('Filtered Signal - Second Order Butterworth');
xlabel('Samples');
ylabel('Amplitude');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment