11

Click here to load reader

Convolución y Digitalización de señales

Embed Size (px)

DESCRIPTION

Objetivos:• Realizar procesamiento de señales mediante el software MatLab.• Utilizar los conceptos de la Convolución y digitalización en el procesamiento de señales.• Creación de distintos tipos de señales: seno, coseno, delta dirac, triangular, tren de pulsos.• Convolución de todas las señales en tiempo continuo.• Discretización de las señales creadas.• Convolución de todas las señales en tiempo discreto• Graficar las señales resultantes y a utilizarse en la convolución.

Citation preview

Autores: Mara Fernanda Bentez Len. Maritza Elizabeth Palacios Morocho.Fecha de elaboracin: Jueves 02/04/15Mdulo: VIII

REPORTE DE LABORATORIO DE PRCTICAS DE COMUNICACIONES ANALGICAS Nro. 1

Tema: Convolucin y Digitalizacin de seales.

Objetivos: Realizar procesamiento de seales mediante el software MatLab. Utilizar los conceptos de la Convolucin y digitalizacin en el procesamiento de seales. Creacin de distintos tipos de seales: seno, coseno, delta dirac, triangular, tren de pulsos. Convolucin de todas las seales en tiempo continuo. Discretizacin de las seales creadas. Convolucin de todas las seales en tiempo discreto Graficar las seales resultantes y a utilizarse en la convolucin.

BREVE RESEA TERICA:La convolucin es una operacin fundamental en procesamiento de seales por su estrecha relacin con los procesos de transmisin de las seales. La funcin de convolucin se expresa por el smbolo *. La convolucin de una funcin de entrada f(x) y la respuesta al impulso de un sistema lineal h(x) representa la cantidad de traslape de una funcin conforme una sta se mueve sobre la otra generando un tipo de combinacin entre las dos funciones g(x) = f(x) h(x). Para hacer posible la transmisin de informacin es necesario realizar algunas operaciones (convolucin, modulacin, etc). En la actualidad las comunicaciones se realizan mediante sistemas digitales lo que conlleva la digitalizacin del mensaje para poder ser transmitido.

TRABAJO EXPERIMENTAL:

% -------------------------------------------------------------------%% SEALES EN TIEMPO CONTINUO% -------------------------------------------------------------------%handles.ejex=0:pi/180:pi/2;handles.x= -10:0.1:10;A=handles.AMPLITUD; % AmplitudB=handles.FRECUENCIA; % Frecuencia fun=get(handles.LISTA,'Value');handles.y1=A*sin(2*pi*B*handles.ejex); %Seno handles.y2=A*cos(2*pi*B*handles.ejex); % Coseno handles.y3=A*sawtooth(2*pi*B*handles.ejex); % Diente de Sierra handles.y4=A*[zeros(1,100),1,zeros(1,100)]; % Delta de Dirac handles.y5=A*sawtooth((B)*handles.x,0.5); % Seal Triangular handles.y6=A*square(handles.x,B); % Tren de pulsos axes(handles.onda)

% -------------------------------------------------------------------%% CONVOLUCIN EN TIEMPO CONTINUO% -------------------------------------------------------------------%

handles.ejex=0:pi/180:pi/2;handles.x= -10:0.1:10;handles.z1=conv(handles.y1,handles.y8); % Convolucin de 2 seales .. % Convolucin de todas las . posibles combinaciones de las .seales .handles.z30=conv(handles.y6,handles.y11);axes(handles.onda6)

% -------------------------------------------------------------------%% DISCRETIZACIN DE LAS SEALES% -------------------------------------------------------------------%

axes(handles.onda4)switch fun case 2 stem(handles.y1); case 3 stem(handles.y2); case 4 stem(handles.y3); case 5 stem(handles.y4); case 6 stem(handles.y5); case 7 stem(handles.y6);end

% -------------------------------------------------------------------%% CONVOLUCIN EN TIEMPO DISCRETO% -------------------------------------------------------------------%switch fun case 2 stem( handles.z1); case 3 stem( handles.z2); case 4 stem( handles.z3); case 5 stem (handles.z4);...

end

Observaciones:

Conclusiones:

El software de Matlab nos facilita el trabajo al momento de realizar convoluciones tanto en tiempo discreto como en tiempo continuo.

Fecha de Defensa: Jueves 09/04/15Calificacin: _____________________

ANEXO:PROGRAMA COMPLETO:Reporte de Laboratorio Nro.1 Convolucin y Digitalizacin de seales.

function varargout = PRACTICA1(varargin)% PRACTICA1 MATLAB code for PRACTICA1.fig% PRACTICA1, by itself, creates a new PRACTICA1 or raises the existing% singleton*.%% H = PRACTICA1 returns the handle to a new PRACTICA1 or the handle to% the existing singleton*.%% PRACTICA1('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in PRACTICA1.M with the given input arguments.%% PRACTICA1('Property','Value',...) creates a new PRACTICA1 or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before PRACTICA1_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to PRACTICA1_OpeningFcn via varargin.%% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one% instance to run (singleton)".%% See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help PRACTICA1 % Last Modified by GUIDE v2.5 08-Apr-2015 01:55:49 % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @PRACTICA1_OpeningFcn, ... 'gui_OutputFcn', @PRACTICA1_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []);if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1});end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});else gui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT % --- Executes just before PRACTICA1 is made visible.function PRACTICA1_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 PRACTICA1 (see VARARGIN) % Choose default command line output for PRACTICA1handles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes PRACTICA1 wait for user response (see UIRESUME)% uiwait(handles.figure1); % --- Outputs from this function are returned to the command line.function varargout = PRACTICA1_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 structurevarargout{1} = handles.output; % --- Executes on selection change in LISTA.function LISTA_Callback(hObject, eventdata, handles)handles.ejex=0:pi/180:pi/2;handles.x= -10:0.1:10;A=handles.AMPLITUD;B=handles.FRECUENCIA;fun=get(handles.LISTA,'Value');handles.y1=A*sin(2*pi*B*handles.ejex);handles.y2=A*cos(2*pi*B*handles.ejex);handles.y3=A*sawtooth(2*pi*B*handles.ejex);handles.y4=A*[zeros(1,100),1,zeros(1,100)];handles.y5=A*sawtooth((B)*handles.x,0.5);handles.y6=A*square(handles.x,B); axes(handles.onda)switch fun case 2 plot(handles.y1); case 3 plot(handles.y2); case 4 plot(handles.y3); case 5 plot(handles.x,handles.y4); case 6 plot(handles.x,handles.y5); case 7 plot(handles.x,handles.y6); endaxes(handles.onda4)switch fun case 2 stem(handles.y1); case 3 stem(handles.y2); case 4 stem(handles.y3); case 5 stem(handles.y4); case 6 stem(handles.y5); case 7 stem(handles.y6);end guidata(hObjetc, handles); % Hints: contents = cellstr(get(hObject,'String')) returns LISTA contents as cell array% contents{get(hObject,'Value')} returns selected item from LISTA % --- Executes during object creation, after setting all properties.function LISTA_CreateFcn(hObject, eventdata, handles)% hObject handle to LISTA (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function FRECUENCIA_Callback(hObject, eventdata, handles)frecuencia=get(hObject,'String');fre=str2double(frecuencia);handles.FRECUENCIA=fre;guidata(hObject,handles); % --- Executes during object creation, after setting all properties.function FRECUENCIA_CreateFcn(hObject, eventdata, handles)% hObject handle to FRECUENCIA (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function AMPLITUD_Callback(hObject, eventdata, handles)amplitud=get(hObject,'String');ampl=str2double(amplitud);handles.AMPLITUD=ampl;guidata(hObject,handles); % --- Executes during object creation, after setting all properties.function AMPLITUD_CreateFcn(hObject, eventdata, handles)% hObject handle to AMPLITUD (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end % --- Executes on selection change in LISTA1.function LISTA1_Callback(hObject, eventdata, handles)axes(handles.onda2)handles.ejex=0:pi/180:pi/2;handles.x= -10:0.1:10;A1=handles.AMPLITUD1;B1=handles.FRECUENCIA1;fun=get(handles.LISTA1,'Value');handles.y7=A1*sin(2*pi*B1*handles.ejex);handles.y8=A1*cos(2*pi*B1*handles.ejex);handles.y9=A1*sawtooth(2*pi*B1*handles.ejex);handles.y10=A1*[zeros(1,100),1,zeros(1,100)];handles.y11=A1*sawtooth((B1)*handles.x,0.5);handles.y12=A1*square(handles.x,B1); axes(handles.onda2)switch fun case 2 plot(handles.y7); case 3 plot(handles.y8); case 4 plot(handles.y9); case 5 plot(handles.x,handles.y10); case 6 plot(handles.x,handles.y11); case 7 plot(handles.x,handles.y12); endaxes(handles.onda5)switch fun case 2 stem(handles.y7); case 3 stem(handles.y8); case 4 stem(handles.y9); case 5 stem(handles.y10); case 6 stem(handles.y11); case 7 stem(handles.y12);endguidata(hObject, handles); % --- Executes during object creation, after setting all properties.function LISTA1_CreateFcn(hObject, eventdata, handles)% hObject handle to LISTA1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end % --- Executes on selection change in CONVOLUCIONES.function CONVOLUCIONES_Callback(hObject, eventdata, handles)handles.ejex=0:pi/180:pi/2;handles.x= -10:0.1:10;A=handles.AMPLITUD;B=handles.FRECUENCIA;A1=handles.AMPLITUD1;B1=handles.FRECUENCIA1;fun=get(handles.CONVOLUCIONES,'Value');handles.y1=A*sin(2*pi*B*handles.ejex);handles.y2=A*cos(2*pi*B*handles.ejex);handles.y3=A*sawtooth(2*pi*B*handles.ejex);handles.y4=A*[zeros(1,100),1,zeros(1,100)];handles.y5=A*sawtooth((B)*handles.x,0.5);handles.y6=A*square(handles.x,B); handles.y7=A1*sin(2*pi*B1*handles.ejex);handles.y8=A1*cos(2*pi*B1*handles.ejex);handles.y9=A1*sawtooth(2*pi*B1*handles.ejex);handles.y10=A1*[zeros(1,100),1,zeros(1,100)];handles.y11=A1*sawtooth((B1)*handles.x,0.5);handles.y12=A1*square(handles.x,B1); handles.z1=conv(handles.y1,handles.y8);handles.z2=conv(handles.y1,handles.y9);handles.z3=conv(handles.y1,handles.y10);handles.z4=conv(handles.y1,handles.y11);handles.z5=conv(handles.y1,handles.y12);handles.z6=conv(handles.y2,handles.y7);handles.z7=conv(handles.y2,handles.y9);handles.z8=conv(handles.y2,handles.y10);handles.z9=conv(handles.y2,handles.y11);handles.z10=conv(handles.y2,handles.y12);handles.z11=conv(handles.y3,handles.y7);handles.z12=conv(handles.y3,handles.y8);handles.z13=conv(handles.y3,handles.y10);handles.z14=conv(handles.y3,handles.y11);handles.z15=conv(handles.y3,handles.y12);handles.z16=conv(handles.y4,handles.y7);handles.z17=conv(handles.y4,handles.y8);handles.z18=conv(handles.y4,handles.y9);handles.z19=conv(handles.y4,handles.y11);handles.z20=conv(handles.y4,handles.y12);handles.z21=conv(handles.y5,handles.y7);handles.z22=conv(handles.y5,handles.y8);handles.z23=conv(handles.y5,handles.y9);handles.z24=conv(handles.y5,handles.y10);handles.z25=conv(handles.y5,handles.y12);handles.z26=conv(handles.y6,handles.y7);handles.z27=conv(handles.y6,handles.y8);handles.z28=conv(handles.y6,handles.y9);handles.z29=conv(handles.y6,handles.y10);handles.z30=conv(handles.y6,handles.y11);axes(handles.onda6)switch fun case 2 stem( handles.z1); case 3 stem( handles.z2); case 4 stem( handles.z3); case 5 stem (handles.z4); case 6 stem( handles.z5); case 7 stem( handles.z6); case 8 stem( handles.z7); case 9 stem( handles.z8); case 10 stem( handles.z9); case 11 stem( handles.z10); case 12 stem( handles.z11); case 13 stem(handles.z12); case 14 stem( handles.z13); case 15 stem( handles.z14); case 16 stem( handles.z15); case 17 stem( handles.z16); case 18 stem(handles.z17); case 19 stem(handles.z18); case 20 stem(handles.z19); case 21 stem(handles.z20); case 22 stem(handles.z21); case 23 stem(handles.z22); case 24 stem(handles.z23); case 25 stem(handles.z24); case 26 stem(handles.z25); case 27 stem(handles.z26); case 28 stem(handles.z27); case 29 stem(handles.z28); case 30 stem(handles.z29); case 31 stem(handles.z30); endaxes(handles.onda3)switch fun case 2 plot( handles.z1); case 3 plot( handles.z2); case 4 plot( handles.z3); case 5 plot(handles.z4); case 6 plot( handles.z5); case 7 plot( handles.z6); case 8 plot( handles.z7); case 9 plot( handles.z8); case 10 plot( handles.z9); case 11 plot( handles.z10); case 12 plot( handles.z11); case 13 plot(handles.z12); case 14 plot( handles.z13); case 15 plot( handles.z14); case 16 plot( handles.z15); case 17 plot( handles.z16); case 18 plot(handles.z17); case 19 plot(handles.z18); case 20 plot(handles.z19); case 21 plot(handles.z20); case 22 plot(handles.z21); case 23 plot(handles.z22); case 24 plot(handles.z23); case 25 plot(handles.z24); case 26 plot(handles.z25); case 27 plot(handles.z26); case 28 plot(handles.z27); case 29 plot(handles.z28); case 30 plot(handles.z29); case 31 plot(handles.z30);endguidata(hObject, handles); % --- Executes during object creation, after setting all properties.function CONVOLUCIONES_CreateFcn(hObject, eventdata, handles)% hObject handle to CONVOLUCIONES (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function AMPLITUD1_Callback(hObject, eventdata, handles)amplitud1=get(hObject,'String');ampl1=str2double(amplitud1);handles.AMPLITUD1=ampl1;guidata(hObject,handles); % --- Executes during object creation, after setting all properties.function AMPLITUD1_CreateFcn(hObject, eventdata, handles)% hObject handle to AMPLITUD1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end function FRECUENCIA1_Callback(hObject, eventdata, handles)frecuencia1=get(hObject,'String');fre1=str2double(frecuencia1);handles.FRECUENCIA1=fre1;guidata(hObject,handles); % --- Executes during object creation, after setting all properties.function FRECUENCIA1_CreateFcn(hObject, eventdata, handles)% hObject handle to FRECUENCIA1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end