% ================================ % Example Signal Analysis % ================================ % Script: Victor M. Espinoza % ================================ clc close all clear all [y, fs] = audioread('C:\Users\Victor\Downloads\A_S1_03.wav'); len = length(y); n = 0:(len-1); t = n/fs; figure(1) %plot(t,y,'linewidth',2) plot(t,20*log10(abs(y)+1e-6),'linewidth',2) ylabel('dBFS') % Análisis de frecuencia [H, f] = pwelch(y,hann(4096),2048,4096,fs,'ms'); figure(2) semilogx(f,10*log10(H),'linewidth',2) [b, a] = butter(2,[80 400]/(fs/2)); y_filt = filter(b,a,y); % Análisis de frecuencia [H_fil, f] = pwelch(y_filt,hann(4096),2048,4096,fs,'ms'); hold on semilogx(f,10*log10(H_fil),'linewidth',2,'color',[1 0 0]) hold off grid figure(1) hold on plot(t,20*log10(abs(y_filt)+1e-6),'linewidth',2,'color',[1 0 0]) hold off figure(3) plot(t,y,'linewidth',2) hold on plot(t,y_filt,'linewidth',2,'color',[1 0 0]) hold off y_env = envelope(y,600,'rms'); figure plot(t,y_env) [y_peaks, I_peaks] = findpeaks(y_env); hold on plot(t(I_peaks),y_peaks,'o') hold off