-
-
Save GiovanniBalestrieri/ef3f05507753121d4220 to your computer and use it in GitHub Desktop.
Snippet - Basic Matlab Filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Analyze signal | |
% Plots magnitude spectrum of the signal | |
X_mags=abs(fft(y)); | |
figure(2) | |
plot(X_mags); | |
xlabel('DFT Bins'); | |
ylabel('Magnitude'); | |
% Plots first half of DFT (normalized frequency) | |
num_bins = length(X_mags); | |
plot([0:1/(num_bins/2 -1):1],X_mags(1:num_bins/2)) | |
xlabel('Normalized frequency [\pi rads/samples]'); | |
ylabel('Magnitude'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment