Skip to content

Instantly share code, notes, and snippets.

@johnnyferreiradev
Created April 9, 2019 00:36
Show Gist options
  • Save johnnyferreiradev/85356fb7420377c6af73dd9b6a515362 to your computer and use it in GitHub Desktop.
Save johnnyferreiradev/85356fb7420377c6af73dd9b6a515362 to your computer and use it in GitHub Desktop.
Processamento Digital de Audio 1
clear all;
close all;
clc;
[Y,fs]=audioread('sine1.wav');
figure(1), port(Y);
Yd = fft(Y);
X_mag = abs(Yd);
N = length(Y);
Fbin = 0:1:N-1;
figure(2), plot((fs/N).*Fbin, X_mag/(N/2))
xlim([0 fs/2])
set(gca, 'FontSize', 16)
xlabel('$f(Hz)$', 'Interpreter', 'LaTex', 'FontSize', 18);
ylabel('$|X(\omega)|$', 'Interpreter', 'LaTex', 'FontSize', 18);
sound(Y, fs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment