Anda di halaman 1dari 7

Asignatura: Simulacin en Ingeniera.

Profesor MIE. Idriss Sandoval V.


POR:

EST. MICHAEL QUINTERO TAMAYO


ING. ELECTRONICA UDI

AUDIO WAV

Elaborada Por:

MICHAEL QUINTERO TAMAYO.

INTRODUCCION
Existen diferentes tipos de archivos de sonido: En las aplicaciones multimedia
los ms utilizados son: .WAV. Es el formato estndar de Windows para
almacenar el sonido. Estos archivos tienen como ventaja fundamental su gran
calidad de sonido, y como principal inconveniente el que necesitan mucho
espacio para su almacenamiento en disco. Permiten almacenar cualquier tipo
de sonido: locucin, msica, .MP3. Este formato, al igual que otros, surgi
por la necesidad de conseguir archivos de sonido menos pesados, esto es
que ocuparan menos espacio en disco. Tienen por tanto como ventaja su mejor
almacenamiento y ms rpida descarga, permitiendo mantener una calidad
ptima del sonido. Al igual que los archivos WAV, los MP3 permiten almacenar
cualquier tipo de sonido.

PROCEDIMIENTO
DESCRIPCION
La siguiente interfaz nos permite ingresar a reproducir un archivo .wav, la cual
podemos elegir en unos de los buttons creados llamado seleccionar archivo,
donde podemos ingresar y buscar el archivo que deseamos reproducir, ya
teniendo nuestro archivo seleccionado lo podemos reproducir, teniendo
encuenta que tambien tiene una opcion de parada con un buttons, otra opcion
que tiene la interfaz son una serie de procesos que le podemos aplicar a la
seal que se esta reproduciendo donde la seal se puede visualizar en el axes
de la interfaz, la cual interactua dependiendo la opcion que se le seleccione.
A continuacin se podr ver el cdigo ejecutado en matlab:
function wav_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject
handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% varargin
command line arguments to wav (see VARARGIN)
a=imread('ele.jpg');
image(a)
axis off
% Choose default command line output for wav
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes wav wait for user response (see UIRESUME)
% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = wav_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject
handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;

% --- Executes on button press in seleccion.

function seleccion_Callback(hObject, eventdata, handles)

global y Fs nbits
[nombre ruta]=uigetfile('*.wav','ABRIR AUDIO');
if nombre==0
return;
else
[y,Fs,nbits]= wavread([ruta nombre]);
end
% hObject
% eventdata
% handles

handle to seleccion (see GCBO)


reserved - to be defined in a future version of MATLAB
structure with handles and user data (see GUIDATA)

% --- Executes on button press in play.


function play_Callback(hObject, eventdata, handles)
global y Fs nbits
sound(y,Fs,nbits);
subplot(1,1,1),plot(y),grid on, zoom,title('SEAL CONTINUA DEL SONIDO');
% hObject
% eventdata
% handles

handle to play (see GCBO)


reserved - to be defined in a future version of MATLAB
structure with handles and user data (see GUIDATA)

% --- Executes on button press in stop.


function stop_Callback(hObject, eventdata, handles)
clear playsnd sound
% hObject
% eventdata
% handles

handle to stop (see GCBO)


reserved - to be defined in a future version of MATLAB
structure with handles and user data (see GUIDATA)

% --- Executes on button press in espectro.


function espectro_Callback(hObject, eventdata, handles)
global y
x=fft(y);
a=x.*conj(x);
f=(100:3000);
subplot(1,1,1),plot(f,a(1:2901)),grid on, zoom,title('ESPECTRO DE LA
SEAL');
%filtro (f,a(1:2901));
% hObject
handle to espectro (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB

% handles

structure with handles and user data (see GUIDATA)

% --- Executes on button press in stem.

function stem_Callback(hObject, eventdata, handles)


global y
n=0:(length(y)-1);
subplot(1,1,1),stem(n,y),grid on, zoom,title('SEAL DISCRETA');
% hObject
handle to stem (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

% --- Executes on button press in filtro.

% --- Executes on button press in diezmado.

function diezmado_Callback(hObject, eventdata, handles)


global y
diezmado=y(1:2:length(y));
%filtro(diezmado);
subplot(1,1,1),plot(diezmado),grid on, zoom,title('DIEZMADO');
% hObject
handle to diezmado (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

% --- Executes on button press in ventanado.


function ventanado_Callback(hObject, eventdata, handles)
global y
h=hamming(length(y));
x=y.*h;
subplot(3,1,1),plot(y),grid on, zoom,title('sonido.wav')
subplot(3,1,2),plot(h),grid on, zoom,title('ventana hamming')
subplot(3,1,3),plot(x),grid on, zoom,title('multiplicacion de sonido con
la ventana hamming')
% hObject
% eventdata
% handles

handle to ventanado (see GCBO)


reserved - to be defined in a future version of MATLAB
structure with handles and user data (see GUIDATA)

% --- Executes on button press in filtro.


function filtro_Callback(hObject, eventdata, handles)
global y
num=[1 1 1];
den=[1 0 -0.1];
y2=filter(num,den,y);
t = 1:length(y);
subplot(2,1,1),plot(t,y,'-'),grid on, zoom,title('SEAL ORIGINAL');
subplot(2,1,2),plot(t,y2,'-'),grid on, zoom,title('FILTRO');
% hObject
handle to filtro (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

ANEXOS

Anda mungkin juga menyukai