0% found this document useful (0 votes)
27 views2 pages

All All 'Nigthwish - Wav'

This document contains code to analyze a noisy audio signal using an adaptive linear neuron (ADALINE) filter. It reads in an original audio signal, adds random noise to create a contaminated signal, then uses an ADALINE filter trained with the random noise to filter out the noise from the contaminated signal. It plots the original, noise, contaminated, and filtered signals and calculates the difference between the original and filtered signals.

Uploaded by

fer6669993
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views2 pages

All All 'Nigthwish - Wav'

This document contains code to analyze a noisy audio signal using an adaptive linear neuron (ADALINE) filter. It reads in an original audio signal, adds random noise to create a contaminated signal, then uses an ADALINE filter trained with the random noise to filter out the noise from the contaminated signal. It plots the original, noise, contaminated, and filtered signals and calculates the difference between the original and filtered signals.

Uploaded by

fer6669993
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

clc

clear all
close all
[s Fs]=wavread('nigthwish.wav');
senal_original=s(1:100000);%seal original a 10seg
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ruido%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
ruido_entrena=rand(1,100000);
ruido1=1.5*ruido_entrena;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%seal
sumada%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ruido_total=ruido1';
senal_total=senal_original+(ruido_total);
%%%%%%%%%%%%%%%%%%%%%%%%%%filtro
adaline%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%parametros de la neurona
dimencion=length(ruido_total);
P=ruido_entrena';
a=senal_total;
%Numero de entradas de la neurona
N=3;
% pesos iniciales
w=rand(1,N);
alpha=0.01;
% Inicializando Matriz para cargar el error
t=zeros(1,dimencion);
% Proceso de aprendizaje
for i=N:dimencion,
t(i)=a(i)-w*P(i-N+1:i);
w=w+(2*t(i)*P(i-N+1:i)')*alpha;
end
%%%%%%%%%%%grafica de las
seales%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t_s = (1:dimencion)/Fs;
ejes=[0 4 -1.5 1.5];
ejes1=[0 0.1 -0.1 3];
ejes2=[0 4 -1.5 5];
ejes3=[0 4 -1.5 1.5];
sound(t,Fs)
subplot(3,2,1);
plot(t_s,senal_original);
axis(ejes);
title('SEAL NORMAL');
grid on;
subplot(3,2,2);
plot(t_s,ruido_total);
axis(ejes1);
title('SEAL RUIDO');
grid on;
subplot(3,2,3);
plot(t_s,senal_total);
axis(ejes2);
title('SEAL CONTAMINADA');
grid on;

subplot(3,2,4);
plot(t_s,t);
axis(ejes3);
title('SEAL FILTRADA');
grid on;
% Resta de las graficas entre la seal de ruido y la original
subplot(3,2,5);
resta_senales=(t-senal_total');
plot(resta_senales);
title('diferencia seal original-sealfiltrada');
grid on;
%
%
%
%
%
%
%
%
%

sound(resta_senales,Fs)
pause
sound(s_r,Fs)
pause
sound(ruido_total,Fs)
pause
sound(senal_total,Fs)
pause
sound(rec,Fs)

You might also like