function varargout = procesado(varargin) % PROCESADO M-file for procesado.fig % PROCESADO, by itself, creates a new PROCESADO or raises the existing % singleton*. % % H = PROCESADO returns the handle to a new PROCESADO or the handle to % the existing singleton*. % % PROCESADO('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in PROCESADO.M with the given input arguments. % % PROCESADO('Property','Value',...) creates a new PROCESADO or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before procesado_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to procesado_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 % Copyright 2002-2003 The MathWorks, Inc. % Edit the above text to modify the response to help procesado % Last Modified by GUIDE v2.5 11-Nov-2005 22:44:45 %DEFINICIÓN DE LA FUNCIÓN %Función que engloba toda la caracterización de los datos. %Los pasos que debemos realizar son los siguientes: %Primero se selecciona los datos que deseamos visualizar %Segundo se selecciona el procesado temporal y a continuación el %frecuencial %Tercero, en función del canal seleccionado, se visualiza un tipo de señal %u otra %Cuarto, se selecciona guardar los resultados o la imagen % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @procesado_OpeningFcn, ... 'gui_OutputFcn', @procesado_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 procesado is made visible. function procesado_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 procesado (see VARARGIN) % Choose default command line output for procesado handles.output = hObject; %INICIALIZACIÓN DE LAS VARIABLES QUE VAMOS A USAR nombre = ''; %Nombre del archivo canales = 0; %Núm. de canales conectados a la tarjeta tmuestreo = 0; %Tasa de muestreo tfiltrado = 0; %Intervalo de t para el filtrado porcentaje = 0; %Porcentaje de desviación para el filtrado visutcanales = 1; %Canal que se desea visualizar en tiempo visufcanales = 1; %Canal que se desea visualizar en frecuencia X = []; %Datos originales en tiempo Xb = []; %Datos filtrados en tiempo Y = []; %Datos originales en tensión Yb = []; %Datos filtrados en tensión maximot = 0; %Máximo en tensión minimot = 0; %Mínimo en tensión medianat = 0; %Mediana en tensión mediat = 0; %Media en tensión desvt = 0; %Desviación en tensión xmax_loc = []; %Posición en t de los máximos locales ymax_loc = []; %Valor en tensión de los máximos locales xmin_loc = []; %Posición en t de los mínimos locales ymin_loc = []; %Valor en tensión de los mínimos locales x2=[]; y2=[]; yComp=[]; orden=0; Pyy = []; %Densidad espectral de Potencia PyyNorm = []; %Densidad espectral de Pot Normalizada PyyPorc = []; %Dens espectral de Pot respecto a la total num_puntos = 0; %Número de puntos usados en la T. de F. Potencia = 0; %Potencia de la señal maximoPotencia = 0; %Máximo de la densidad espectral minimoPotencia = 0; %Mínimo de la densidad espectral localmaxPot = []; %Máximos locales de la dens. espectral localminPot = []; %Mínimos locales de la dens. espectral flagaceptar = 0; %1 se ha almacenado correctamente los datos a1 = 0; %Ejes para la señal original a2 = 0; %Ejes para la señal filtrada a3 = 0; %Ejes para la original+filtrada a4 = 0; %Ejes para una porción a5 = 0; %Ejes para dens. espec. pot a6 = 0; %Ejes para dens. espec. normalizada a7 = 0; %Ejes para dens. espec. porcentaje h1 = 0; %Figuras para todos los ejes anteriores h2 = 0; h3 = 0; h4 = 0; h5 = 0; h6 = 0; h7 = 0; fecha = ''; hora = ''; handles.nombre = nombre; handles.canales = canales; handles.tmuestreo = tmuestreo; handles.tfiltrado = tfiltrado; handles.porcentaje = porcentaje; handles.visutcanales = visutcanales; handles.visufcanales = visufcanales; handles.X = X; handles.Y = Y; handles.Xb = Xb; handles.Yb = Yb; handles.maximot = maximot; handles.minimot = minimot; handles.medianat = medianat; handles.mediat = mediat; handles.desvt = desvt; handles.xmaximolocalt = xmax_loc; handles.ymaximolocalt = ymax_loc; handles.xminimolocalt = xmin_loc; handles.yminimolocalt = ymin_loc; handles.Pyy = Pyy; handles.PyyNorm = PyyNorm; handles.PyyPorc = PyyPorc; handles.num_puntos = num_puntos; handles.Potencia = Potencia; handles.minimoPotencia = minimoPotencia; handles.maximoPotencia = maximoPotencia; handles.localmaxPot = localmaxPot; handles.localminPot = localminPot; handles.x2 = x2; handles.y2 = y2; handles.orden = orden; handles.yComp = yComp; handles.a1 = a1; handles.a2 = a2; handles.a3 = a3; handles.a4 = a4; handles.a5 = a5; handles.a6 = a6; handles.a7 = a7; handles.h1 = h1; handles.h2 = h2; handles.h3 = h3; handles.h4 = h4; handles.h5 = h5; handles.h6 = h6; handles.h7 = h7; handles.fecha = fecha; handles.hora = hora; A=[]; %Se capturan y se representan unas imágenes por defecto en los huecos donde %se van a representar las señales A=imread('logo','jpeg'); axes(handles.dominio_temporal) image(A); axes(handles.dominio_frecuencial) image(A); % Update handles structure guidata(hObject, handles); % UIWAIT makes procesado wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = procesado_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 leer_push. function leer_push_Callback(hObject, eventdata, handles) % hObject handle to leer_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Captura los datos que se han introducido mediante el archivo 'datos' %como el nombre, canales, tiempo de filtado y el porcentaje de %desviación admisibe para el filtrado. nombre = ''; canales = 0; tmuestreo = 0; tmuestreos = ''; tmuestreov = 0; flagaceptar = 0; A = []; %Solicitamos al usuario que introduzca los datos de las señales [nombre,canales,tmuestreo,flagaceptar]=datos_generales; if flagaceptar==1 %Motramos los resultados introducidos por el usuario y se almacenan %en sus correspondientes variables handles.nombre=nombre; set(handles.nombrer_text,'String',nombre); handles.canales=canales; set(handles.canalesr_text,'String',canales); handles.tmuestreo=tmuestreo; set(handles.tmuestreor_text,'String',tmuestreo); set(handles.leer_push,'BackgroundColor',[0 0 1]); %Cada vez que se pulse 'Leer_datos', se limpiarán todas los botones %para que no se solape información de distintos archivos que pueda %confundir al usuario set(handles.leerfiltrado_push,'Background',[0.925 0.914 0.847]); set(handles.procesart_push,'Background',[0.925 0.914 0.847]); set(handles.procesadof_push,'Background',[0.925 0.914 0.847]); set(handles.original_push,'Background',[0.925 0.914 0.847]); set(handles.filtrada_push,'Background',[0.925 0.914 0.847]); set(handles.orifil_push,'Background',[0.925 0.914 0.847]); set(handles.porcion_push,'Background',[0.925 0.914 0.847]); % set(handles.imagen_push,'BackgroundColor',[0.925 0.914 0.847]) set(handles.naturales_push,'Background',[0.925 0.914 0.847]); set(handles.normalizada_push,'Background',[0.925 0.914 0.847]); set(handles.porcentaje_push,'Background',[0.925 0.914 0.847]); % set(handles.imagenf_push,'BackgroundColor',[0.925 0.914 0.847]); set(handles.guardar1_push,'BackgroundColor',[0.925 0.914 0.847]); set(handles.guardarf_push,'BackgroundColor',[0.925 0.914 0.847]); set(handles.maxtr_text,'String',0); set(handles.mintr_text,'String',0); set(handles.mediatr_text,'String',0); set(handles.medianatr_text,'String',0); set(handles.desvtr_text,'String',0); set(handles.arear_text,'String',0); set(handles.potenciar_text,'String',0); set(handles.maxfr_text,'String',0); set(handles.minfr_text,'String',0); set(handles.canaltres_popup,'Value',1); set(handles.canalt_popup,'Value',1); set(handles.canalfres_popup,'Value',1); set(handles.canalf_popup,'Value',1); %Cada vez que se leen los datos, se limpian las imágenes y en su lugar %colocamos un fondo A=imread('logo','jpeg'); axes(handles.dominio_temporal) set(handles.dominio_temporal,'NextPlot','new'); legend off xlabel('');ylabel('');title('') set(handles.dominio_temporal,'YDir','reverse'); set(handles.dominio_temporal,'XTick',[]); set(handles.dominio_temporal,'visible','on'); set(handles.dominio_temporal,'YTick',[]); set(handles.dominio_temporal,'YtickLabel',[]); image(A); axes(handles.dominio_frecuencial) set(handles.dominio_frecuencial,'NextPlot','new'); legend off xlabel('');ylabel('');title('') set(handles.dominio_frecuencial,'YDir','reverse'); set(handles.dominio_frecuencial,'XTick',[]); set(handles.dominio_frecuencial,'visible','on'); set(handles.dominio_frecuencial,'YTick',[]); set(handles.dominio_frecuencial,'YtickLabel',[]); image(A); guidata(hObject,handles) end % --- Executes on button press in procesart_push. function procesart_push_Callback(hObject, eventdata, handles) % hObject handle to procesart_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Una vez que ya se han leido los datos, realizamos el procesado de la señal %en el dominio temporal. tasa_muestreo = handles.tmuestreo; num_canales = handles.canales; por_desv = handles.porcentaje; DeltaT = handles.tfiltrado; nombreFichero = handles.nombre; if por_desv==0 | DeltaT==0 %Se avisa al usuario de que no se realizará ningún filtrado si éste no %ha seleccionado un tiempo o un porcentaje para realizar el filtrado warndlg('AVISO: No se va a realizar ningún filtrado','AVISO') end if(get(handles.leer_push,'BackgroundColor')==[0 0 1]) [X,Y,Xb,Yb,Max,Min,Mediana,Media,Desv,... xmax_loc,ymax_loc,xmin_loc,... ymin_loc,fecha,hora]=func_principal(tasa_muestreo,num_canales,por_desv,... DeltaT,nombreFichero); handles.X = X; handles.Y = Y; handles.Xb = Xb; handles.Yb = Yb; handles.maximot = Max; handles.minimot = Min; handles.medianat = Mediana; handles.mediat = Media; handles.desvt = Desv; handles.xmaximolocalt = xmax_loc; handles.ymaximolocalt = ymax_loc; handles.xminimolocalt = xmin_loc; handles.yminimolocalt = ymin_loc; handles.fecha = fecha; handles.hora = hora; %almaceno todos las variables en un .mat para realizar el posterior %informe en caso de que lo solicite el usuario save tiempo X Y Xb Yb Max Min Mediana Media Desv xmax_loc xmin_loc ymax_loc ymin_loc num_canales tasa_muestreo %Una vez que se ha realizado correctamente el procesado, pintamos el botón %en azul para indicar que se ha realizado correctamente set(handles.procesart_push,'BackgroundColor',[0 0 1]); guidata(hObject, handles); else errordlg('ERROR: Primero debe introducir los datos','ERROR') end % --- Executes on button press in original_push. function original_push_Callback(hObject, eventdata, handles) % hObject handle to original_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Representa la señal original para el canal seleccionado v = []; pintar = ['b' 'r' 'y' 'k' 'c' 'm' 'b+' 'r*']; vemos = []; %sólo se puede visualizar la señal una vez que se ha procesado if(get(handles.procesart_push,'BackgroundColor')==[0 0 1]) visuca = handles.visutcanales; if (visuca-2) <= handles.canales axes(handles.dominio_temporal) set(handles.dominio_temporal,'NextPlot','replace') plot(handles.X,handles.Y(:,visuca)) title('Datos Originales') xlabel('t (s)') if visuca==1 ylabel('Temperatura (ºC)') vemos = [vemos;'Temperatura']; elseif visuca==2 ylabel('Humedad (%)') vemos = [vemos;'Humedad']; else ylabel('Magnitud (V)') vemos = [vemos;strcat('Canal:',num2str(visuca-2))]; end legend(vemos) % hold off set(handles.dominio_temporal,'XMinorTick','on') %Se pinta el cuadro el azul y se limpian los demás para saber lo que %se está visualizando en la pantalla set(handles.original_push,'Background',[0 0 1]); set(handles.filtrada_push,'Background',[0.925 0.914 0.847]); set(handles.orifil_push,'Background',[0.925 0.914 0.847]); set(handles.porcion_push,'Background',[0.925 0.914 0.847]); % set(handles.imagen_push,'BackgroundColor',[0.925 0.914 0.847]) guidata(hObject,handles); else errordlg('ATENCION: El canal introducido está desconectado','ERROR') end else %Sin realizar el procesado temporal no se visualiza nada errordlg('ERROR: Primero debe procesar la señal','ERROR'); end % --- Executes on button press in filtrada_push. function filtrada_push_Callback(hObject, eventdata, handles) % hObject handle to filtrada_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Representa la señal filtrada para el canal seleccionado v = []; pintar = ['b' 'r' 'y' 'k' 'c' 'm' 'b+' 'r*']; vemos = []; %Se comprueba que se ha realizado el procesado (botón en azul) if(get(handles.procesart_push,'BackgroundColor')==[0 0 1]) visuca = handles.visutcanales; if (visuca-2)<=handles.canales %el -2 equivale a que el primero es la temperatura y después la %humedad axes(handles.dominio_temporal) set(handles.dominio_temporal,'NextPlot','replace') plot(handles.Xb(:,visuca),handles.Yb(:,visuca)) title('Datos Filtrados') xlabel('t (s)') if visuca==1 ylabel('Temperatura (ºC)') vemos = [vemos;'Temperatura']; elseif visuca==2 ylabel('Humedad (%)') vemos = [vemos;'Humedad']; else ylabel('Magnitud (V)') vemos = [vemos;strcat('Canal:',num2str(visuca-2))]; end legend(vemos) set(handles.dominio_temporal,'XMinorTick','on') %Se pinta el cuadro el azul y se limpian los demás para saber lo que %se está visualizando en la pantalla set(handles.original_push,'Background',[0.925 0.914 0.847]); set(handles.filtrada_push,'Background',[0 0 1]); set(handles.orifil_push,'Background',[0.925 0.914 0.847]); set(handles.porcion_push,'Background',[0.925 0.914 0.847]); % set(handles.imagen_push,'BackgroundColor',[0.925 0.914 0.847]) guidata(hObject,handles); else errordlg('ATENCION: El canal introducido no está conectado','ERROR') end else errordlg('ERROR: Primero debe procesar la señal','ERROR'); end % --- Executes on button press in naturales_push. function naturales_push_Callback(hObject, eventdata, handles) % hObject handle to naturales_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Representa la densidad espectral de potencia en unidades naturales para el %canal que se ha seleccionado v = []; pintar = ['b' 'r' 'y' 'k' 'c' 'm' 'b+' 'r*']; vemos = []; %Se debe procesar la señal en frecuencia antes de visualizar los %datos en pantalla if (get(handles.procesadof_push,'BackgroundColor')==[0 0 1]) visuca = handles.visufcanales; if (visuca-2)<=handles.canales axes(handles.dominio_frecuencial) set(handles.dominio_frecuencial,'NextPlot','replace') f=(0:handles.num_puntos/2-1)/(handles.tmuestreo*handles.num_puntos); plot(f,handles.Pyy(1:handles.num_puntos/2,visuca)) title('Densidad espectral de Potencia') xlabel('f (Hz)') ylabel('Densidad espectral de Potencia') if visuca==1 vemos='Temperatura'; elseif visuca==2 vemos='Humedad'; else vemos=[vemos;strcat('Canal:',num2str(visuca-2))]; end legend(vemos) set(handles.dominio_frecuencial,'XMinorTick','on') %Se pinta la casilla de naturales en azul y el resto en blanco para %saber lo que se esta realizando set(handles.naturales_push,'Background',[0 0 1]); set(handles.normalizada_push,'Background',[0.925 0.914 0.847]); set(handles.porcentaje_push,'Background',[0.925 0.914 0.847]); % set(handles.imagenf_push,'BackgroundColor',[0.925 0.914 0.847]); guidata(hObject,handles); else errordlg('ATENCION: El canal introducido no está conectado','ERROR') end else errordlg('ERROR: Primero debe procesar los datos en frecuencia','ERROR') end % --- Executes on button press in normalizada_push. function normalizada_push_Callback(hObject, eventdata, handles) % hObject handle to normalizada_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Representación de la densidad espectral de potencia en unidades %normalizadas del canal que haya seleccionado el usuario v = []; pintar = ['b' 'r' 'y' 'k' 'c' 'm' 'b+' 'r*']; vemos = []; %Comprobación que se han procesado los datos en el dominio de la frecuencia if (get(handles.procesadof_push,'BackgroundColor')==[0 0 1]) visuca = handles.visufcanales; if (visuca-2)<=handles.canales %Se evita que se introduzca un canal no conectado %Vector del eje temporal, es decir, la frecuencia f=(0:handles.num_puntos/2-1)/(handles.tmuestreo*handles.num_puntos); axes(handles.dominio_frecuencial) set(handles.dominio_temporal,'NextPlot','replace') plot(f,handles.PyyNorm(1:handles.num_puntos/2,visuca)) title('Densidad espectral de Potencia normalizada') xlabel('f (Hz)') ylabel('Dens. Espectral de Potencia (normalizada)') if visuca==1 vemos='Temperatura'; elseif visuca==2 vemos='Humedad'; else vemos=[vemos;strcat('Canal:',num2str(visuca-2))]; end legend(vemos) set(handles.dominio_frecuencial,'XMinorTick','on') %Cada vez que pintamos una imagen en los ejes, también vamos a %crear un figure para poder posteriormente almacenar la imagen en %bmp clear vemos vemos = []; %Se pinta la casilla en azul y las demás en blanco para conocer lo %que se está realizando set(handles.normalizada_push,'Background',[0 0 1]); set(handles.naturales_push,'Background',[0.925 0.914 0.847]); set(handles.porcentaje_push,'Background',[0.925 0.914 0.847]); % set(handles.imagenf_push,'BackgroundColor',[0.925 0.914 0.847]); guidata(hObject,handles); else errordlg('ATENCION: El canal introducido no está conectado','ERROR') end else errordlg('ERROR: Primero debe procesar los datos en frecuencia','ERROR') end % --- Executes on button press in porcentaje_push. function porcentaje_push_Callback(hObject, eventdata, handles) % hObject handle to porcentaje_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Representación de la densidad espectral de potencia con respecto al total %de Potencia para el canal que haya solicitado el usuario v = []; pintar = ['b' 'r' 'y' 'k' 'c' 'm' 'b+' 'r*']; vemos = []; %Comprobación que se ha procesado la señal en el dominio de la frecuencia if (get(handles.procesadof_push,'BackgroundColor')==[0 0 1]) visuca = handles.visufcanales; if (visuca-2)<=handles.canales %Se impide visualizar un canal que no esta conectado %Se crea el vector de frecuencia f = (0:handles.num_puntos/2-1)/(handles.tmuestreo*handles.num_puntos);% axes(handles.dominio_frecuencial) set(handles.dominio_temporal,'NextPlot','replace') plot(f,handles.PyyPorc(1:handles.num_puntos/2,visuca)) title('Porcentaje de Potencia con respecto al total') xlabel('f(Hz)') ylabel('Dens. Espectral de Potencia (%)') if visuca==1 vemos='Temperatura'; elseif visuca==2 vemos='Humedad'; else vemos = [vemos;strcat('Canal:',num2str(visuca-2))]; end legend(vemos) set(handles.dominio_frecuencial,'XMinorTick','on') %Cada vez que pintamos una imagen en los ejes, también vamos a %crear un figure para poder posteriormente almacenar la imagen en %bmp clear vemos vemos = []; %Se pinta la casilla en azul y el resto en blanco para saber qué es lo %que se está representando en pantalla set(handles.porcentaje_push,'Background',[0 0 1]); set(handles.normalizada_push,'Background',[0.925 0.914 0.847]); set(handles.naturales_push,'Background',[0.925 0.914 0.847]); % set(handles.imagenf_push,'BackgroundColor',[0.925 0.914 0.847]); guidata(hObject,handles); else errordlg('ATENCION: El canal introducido no está conectado','ERROR') end else errordlg('ERROR: Primero debe procesar los datos en frecuencia','ERROR') end % --- Executes on button press in porcion_push. function porcion_push_Callback(hObject, eventdata, handles) % hObject handle to porcion_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Permite seleccionar un canal de los conectados y dos extremos para %caracterizar dicha porción de señal flagaceptar = 0; %1=selección de entremos correcta, 0=eoc flagorden = 0; %1=orden del polinomio correcto, 0=eoc canal = 0; %Canal seleccionado para el procesado x1 = 0; %Extremo superior x0 = 0; %Extremo inferior metodo = 0; %1=salida incorrecta, %2=aproximación Simpson, 3=aproximación trapezoidal polinomio = 0; %Orden del polinomio x2 = []; y2 = []; yComp = []; %Comprobación que se ha realizado el procesado de los datos if (get(handles.procesart_push,'BackgroundColor')==[0 0 1]) X = handles.X; n = length(X); tmuestreo = handles.tmuestreo; ttotal = (n-1)*tmuestreo; canales = handles.canales; [canal,x1,x0,flagaceptar]=seleccionarextremos(tmuestreo,ttotal,canales); if (flagaceptar==1) & ((canal-3)<=handles.canales) i = round(x0/tmuestreo+1); j = round(x1/tmuestreo+1); x2 = X(i:j); Y=handles.Yb; Y2 = Y(:,canal-1); y2 = Y2(i:j); [flagvalidacion]=validacion(x2,y2,canal); if flagvalidacion==1 [metodo,N,flagorden]=aproximacion_orden; if ((flagorden==1)) %Calculamos los parametros basicos para esos intervalos y el area segun %el metodo y la aproximacion en area que solicite el usuario [x2,y2,yComp,area,max_ex,min_ex,mediana_ex,media_ex,... desv_ex,xmax_loc_ex,ymax_loc_ex,xmin_loc_ex,... ymin_loc_ex]=porcion_caract(handles.Xb(:,canal-1),... handles.Yb(:,canal-1),x0,x1,handles.tmuestreo,N,metodo); %Actualización del canal que se va a representar y guardar %resultados handles.visutcanales=canal-1; handles.x2=x2; handles.y2=y2; handles.orden=N; handles.yComp=yComp; %Almacen de los resultados obtenidos en las casillas %correspondientes del cuadro de resultados set(handles.maxtr_text,'String',num2str(max_ex)) set(handles.mintr_text,'String',num2str(min_ex)) set(handles.medianatr_text,'String',num2str(mediana_ex)) set(handles.mediatr_text,'String',num2str(media_ex)) set(handles.desvtr_text,'String',num2str(desv_ex)) set(handles.arear_text,'String',num2str(area)) c=canal-1; set(handles.canaltres_popup,'Value',canal) set(handles.canalt_popup,'Value',c) %Representación de la señal y su reconstrucción %entre los extremos indicados axes(handles.dominio_temporal) set(handles.dominio_temporal,'NextPlot','replace') if isempty(yComp)==1 %Representación solo de la porción si usamos el método %trapezoidal plot(x2,y2,'r') if min_ex~=max_ex axis([x0 x1 min_ex max_ex]) end xlabel('t (s)') ylabel('Magnitud (V)') title(strcat('Porción de señal seleccionada del canal',... num2str(canal),'(Aprox. trapezoidal)')) else %Representación de la reconstrucción si hemos usado el método %de Simpson plot(x2,y2,'r',x2,yComp,'b+:') if min_ex~=max_ex axis([x0 x1 min_ex max_ex]) end legend('S. Original',strcat('S. Reconstruida',... '(orden',num2str(N),')')) xlabel('t (s)') if canal==2 ylabel('Temperatura (ºC)') title(strcat('Porcion seleccionada y reconstruida',... ' con el pol. de interpolacion de Temperatura')) elseif canal==3 ylabel('Humedad (%)') title(strcat('Porcion seleccionada y reconstruida',... ' con el pol. de interpolacion de Humedad')) else ylabel('Magnitud (V)') title(strcat('Porcion seleccionada y reconstruida',... ' con el pol. de interpolacion del canal',num2str(canal-3))) end end %Se pinta la casilla en azul para saber lo que se está realizando, las %demás se dejan en blanco set(handles.porcion_push,'Background',[0 0 1]); set(handles.filtrada_push,'Background',[0.925 0.914 0.847]); set(handles.orifil_push,'Background',[0.925 0.914 0.847]); set(handles.original_push,'Background',[0.925 0.914 0.847]); % set(handles.imagen_push,'BackgroundColor',[0.925 0.914 0.847]) guidata(hObject,handles); else errordlg('ERROR: No ha seleccionado el método de aproximación del área ni el orden del polinomio','ERROR'); end else warndlg('AVISO: Vuelva a seleccionar los extremos','AVISO') end elseif (canal-3)>handles.canales errordlg('ERROR: El canal seleccionado no puede ser mayor que el número de canales conectados','ERROR'); else warndlg('AVISO: No se va a mostrar ninguna señal','AVISO'); end else errordlg('ERROR: Primero debe procesar los datos','ERROR'); end % --- Executes on button press in guardar1_push. function guardar1_push_Callback(hObject, eventdata, handles) % hObject handle to guardar1_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Solicitud de grabación de los resultados para el dominio temporal X = handles.X; Y = handles.Y; Xb = handles.Xb; Yb = handles.Yb; maximot = handles.maximot; minimot = handles.minimot; medianat= handles.medianat; mediat = handles.mediat; desvt = handles.desvt; xmaximolocalt = handles.xmaximolocalt; ymaximolocalt = handles.ymaximolocalt; xminimolocalt = handles.xminimolocalt; yminimolocalt = handles.yminimolocalt; %Comprobación que se ha realizado el procesado temporal if (get(handles.procesart_push,'BackgroundColor')==[0 0 1]) guardart(X,Y,Xb,Yb,maximot,minimot,medianat,mediat,desvt,... xmaximolocalt,ymaximolocalt,xminimolocalt,yminimolocalt); set(handles.guardar1_push,'BackgroundColor',[0 0 1]); else errordlg('Antes de guardar los datos debe realizar el procesado temporal','ERROR') end % --- Executes on button press in guardarf_push. function guardarf_push_Callback(hObject, eventdata, handles) % hObject handle to guardarf_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Solicitud de almacenamiento de los resultados obtenidos en el dominio frecuencial Pyy = handles.Pyy; PyyNorm = handles.PyyNorm; PyyPorc = handles.PyyPorc; num_puntos = handles.num_puntos; Potencia = handles.Potencia; maximoPotencia = handles.maximoPotencia; minimoPotencia = handles.minimoPotencia; localmaxPot = handles.localmaxPot; localminPot = handles.localminPot; %Comprobación que se ha realizado el procesado frecuencial if (get(handles.procesadof_push,'BackgroundColor')==[0 0 1]) set(handles.guardarf_push,'BackgroundColor',[0 0 1]); guardarf(Pyy,PyyNorm,PyyPorc,num_puntos,Potencia,... maximoPotencia,minimoPotencia,localmaxPot,localminPot) else errordlg('Antes de guardar los dato debe realizar el procesado frecuencial','ERROR') end % --- Executes on button press in procesadof_push. function procesadof_push_Callback(hObject, eventdata, handles) % hObject handle to procesadof_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Permite realizar el procesado en el dominio de la frecuencia a los datos %filtrados del archivo que ha introducido el usuario if (get(handles.leer_push,... 'BackgroundColor')==[0 0 1] & get(handles.procesart_push,... 'BackgroundColor')==[0 0 1]) [Pyy,PyyNorm,PyyPorc,Potencia,maximoPotencia,minimoPotencia,... localmaxPot,localminPot,... num_puntos] = analisisFourier(handles.Xb,handles.Yb,... handles.tmuestreo,handles.canales); if num_puntos == -1 errordlg('ERROR: No se va a realizar el procesado en frecuencia porque no ha introducido el número de puntos','ERROR') else %guardamos todas las variables en un .mat para poderlas usarlas al %crear el html tmuestreo = handles.tmuestreo; canales = handles.canales; save frecuencia Pyy PyyNorm PyyPorc tmuestreo canales num_puntos Potencia maximoPotencia minimoPotencia localmaxPot localminPot handles.Pyy = Pyy; handles.PyyNorm = PyyNorm; handles.PyyPorc = PyyPorc; handles.num_puntos = num_puntos; handles.Potencia = Potencia; handles.maximoPotencia = maximoPotencia; handles.minimoPotencia = minimoPotencia; handles.localmaxPot = localmaxPot; handles.localminPot = localminPot; set(handles.procesadof_push,'BackgroundColor',[0 0 1]); guidata(hObject, handles); end elseif get(handles.leer_push,'BackgroundColor')==[0.925 0.914 0.847] errordlg('ERROR: Primero debe introducir los datos','ERROR') else errordlg('ERROR: Primero debe procesar temporalmente para introducir los datos filtrados','ERROR') end % --- Executes on selection change in canalt_popup. function canalt_popup_Callback(hObject, eventdata, handles) % hObject handle to canalt_popup (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Capturación de canal que se desea visualizar en el dominio temporal visutcanales = 0; visutcanales = get(hObject,'Value'); handles.visutcanales = visutcanales; %0 %1 es la temperatura %2 es la humedad %el resto de canales es sucesivamente guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function canalt_popup_CreateFcn(hObject, eventdata, handles) % hObject handle to canalt_popup (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in canalf_popup. function canalf_popup_Callback(hObject, eventdata, handles) % hObject handle to canalf_popup (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Capturación del canal que se desea representar en el dominio frecuencial visufcanales = 0; visufcanales = get(hObject,'Value'); handles.visufcanales = visufcanales; guidata(hObject, handles); % --- Executes during object creation, after setting all properties. function canalf_popup_CreateFcn(hObject, eventdata, handles) % hObject handle to canalf_popup (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in canaltres_popup. function canaltres_popup_Callback(hObject, eventdata, handles) % hObject handle to canaltres_popup (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Capturamos el canal sobre el cual queremos obtener los parámetros %principales % canals=get(hObject,'String'); canalv=get(hObject,'Value'); %el cero no es nada, el 1 la temperatura, el 2 la humedad y el restro %recursivamente canal=canalv; if canal==1 errordlg('ERROR: Debe seleccionar un canal distinto de 0','ERROR') set(handles.maxtr_text,'String',0); set(handles.mintr_text,'String',0); set(handles.mediatr_text,'String',0); set(handles.medianatr_text,'String',0); set(handles.desvtr_text,'String',0); set(handles.arear_text,'String',0) else if ((canal-3)<=handles.canales) %El numero de canal que introducido no puede ser mayor que el %número de canales conectados maximot = handles.maximot; minimot = handles.minimot; medianat = handles.medianat; mediat = handles.mediat; desvt = handles.desvt; %Relleno de los huecos con los datos correspondientes set(handles.maxtr_text,'String',maximot(canal-1)); set(handles.mintr_text,'String',minimot(canal-1)); set(handles.mediatr_text,'String',mediat(canal-1)); set(handles.medianatr_text,'String',medianat(canal-1)); set(handles.desvtr_text,'String',desvt(canal-1)); set(handles.arear_text,'String',0); else errordlg('ERROR: el canal seleccionado no se ha conectado','ERROR') set(handles.maxtr_text,'String',0); set(handles.mintr_text,'String',0); set(handles.mediatr_text,'String',0); set(handles.medianatr_text,'String',0); set(handles.desvtr_text,'String',0); set(handles.arear_text,'String',0) end end % --- Executes during object creation, after setting all properties. function canaltres_popup_CreateFcn(hObject, eventdata, handles) % hObject handle to canaltres_popup (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in canalfres_popup. function canalfres_popup_Callback(hObject, eventdata, handles) % hObject handle to canalfres_popup (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Captura del canal del cual queremos representar sus principales %estadísticas % canals = get(hObject,'String'); canalv = get(hObject,'Value'); canal = canalv; canales = handles.canales; if canal==1 errordlg('ERROR: Debe seleccionar un canal distinto de 0','ERROR'); set(handles.potenciar_text,'String',0); set(handles.maxfr_text,'String',0); set(handles.minfr_text,'String',0); else if(canales>=(canal-3)) %El canal seleccionado está dentro del rango de canales %introducidos Potencia = handles.Potencia; maximoPotencia = handles.maximoPotencia; minimoPotencia = handles.minimoPotencia; set(handles.potenciar_text,'String',num2str(Potencia(canal-1))); set(handles.maxfr_text,'String',num2str(maximoPotencia(canal-1))); set(handles.minfr_text,'String',num2str(minimoPotencia(canal-1))); else errordlg('ERROR: El canal seleccionado no se ha conectado','ERROR'); set(handles.potenciar_text,'String',0); set(handles.maxfr_text,'String',0); set(handles.minfr_text,'String',0); end end % --- Executes during object creation, after setting all properties. function canalfres_popup_CreateFcn(hObject, eventdata, handles) % hObject handle to canalfres_popup (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 set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on button press in gridt_radio. function gridt_radio_Callback(hObject, eventdata, handles) % hObject handle to gridt_radio (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Introducción del grid a cualquier imagen en el dominio temporal axes(handles.dominio_temporal) if (get(hObject,'Value')==get(hObject,'Max')) grid on else grid off end % --- Executes on button press in zoomt_radio. function zoomt_radio_Callback(hObject, eventdata, handles) % hObject handle to zoomt_radio (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Zoom de cualquier imagen en el dominio temporal axes(handles.dominio_temporal) if(get(hObject,'Value')==get(hObject,'Max')) zoom on else zoom off end % --- Executes on button press in gridf_radio. function gridf_radio_Callback(hObject, eventdata, handles) % hObject handle to gridf_radio (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Introcción de grid a cualquier imagen en el dominio frecuencial axes(handles.dominio_frecuencial) if (get(hObject,'Value')==get(hObject,'Max')) grid on else grid off end % --- Executes on button press in zoomf_radio. function zoomf_radio_Callback(hObject, eventdata, handles) % hObject handle to zoomf_radio (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Introducción de zomm a cualquier imagen en el dominio frecuencial axes(handles.dominio_frecuencial) if (get(hObject,'Value')==get(hObject,'Max')) zoom on else zoom off end % --- Executes on button press in orifil_push. function orifil_push_Callback(hObject, eventdata, handles) % hObject handle to orifil_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Representación de la señal original y filtrada para el canal seleccionado %por el usuario visuca = 0; vemos=[]; %Comprobación que se ha procesado la señal if(get(handles.procesart_push,'BackgroundColor')==[0 0 1]) visuca = handles.visutcanales; if (visuca-2) <=handles.canales axes(handles.dominio_temporal) set(handles.dominio_temporal,'NextPlot','replace') plot(handles.X,handles.Y(:,visuca),'r',... handles.Xb(:,visuca),handles.Yb(:,visuca),'b') xlabel('t (s)') legend('Original','Filtrada') if visuca==1 ylabel('Temperatura (ºC)') vemos = [vemos;'Temperatura']; elseif visuca==2 ylabel('Humedad (%)') vemos = [vemos;'Humedad']; else ylabel('Magnitud (V)') vemos = [vemos;strcat('Canal:',num2str(visuca-2))]; end title(strcat('Datos Originales + Datos Filtrados de ',... vemos)) set(handles.dominio_temporal,'XMinorTick','on') %Se pinta el cuadro en azul y los demás se dejan en %blanco para indicar lo que se está realizando set(handles.orifil_push,'Background',[0 0 1]); set(handles.filtrada_push,'Background',[0.925 0.914 0.847]); set(handles.original_push,'Background',[0.925 0.914 0.847]); set(handles.porcion_push,'Background',[0.925 0.914 0.847]); % set(handles.imagen_push,'BackgroundColor',[0.925 0.914 0.847]) guidata(hObject,handles) else errordlg('ATENCION: El canal introducido no está conectado','ERROR') end else errordlg('ERROR:Primero debe procesar la señal','ERROR'); end % --- Executes on button press in ayuda_push. function ayuda_push_Callback(hObject, eventdata, handles) % hObject handle to ayuda_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) ayudaprocesado % --- Executes on button press in siguiente_push. function siguiente_push_Callback(hObject, eventdata, handles) % hObject handle to siguiente_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) if get(handles.procesart_push,'BackgroundColor')==[0 0 1] closereq Fin(handles.X,handles.Y,handles.canales,handles.tmuestreo,handles.fecha,handles.hora); else errordlg('ERROR: Para visualizar los vídeos, es necesario que haya procesado los datos','ERROR') end % --- Executes on button press in cancelar_push. function cancelar_push_Callback(hObject, eventdata, handles) % hObject handle to cancelar_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) closereq % --- Executes on button press in leerfiltrado_push. function leerfiltrado_push_Callback(hObject, eventdata, handles) % hObject handle to leerfiltrado_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) tfiltrado = 0; porcentaje = 0; flagaceptar = 0; A=[]; if get(handles.leer_push,'Background')==[0 0 1] [tfiltrado,porcentaje,flagaceptar]=datos_filtrado; if flagaceptar==1 handles.tfiltrado=tfiltrado; set(handles.tfiltrador_text,'String',tfiltrado); handles.porcentaje=porcentaje; set(handles.porcentajer_text,'String',porcentaje); set(handles.leerfiltrado_push,'BackgroundColor',[0 0 1]); %Una vez que realizamos un filtrado, limpiamos todos los datos para %saber lo que estamos visualizando set(handles.procesart_push,'Background',[0.925 0.914 0.847]); set(handles.procesadof_push,'Background',[0.925 0.914 0.847]); set(handles.original_push,'Background',[0.925 0.914 0.847]); set(handles.filtrada_push,'Background',[0.925 0.914 0.847]); set(handles.orifil_push,'Background',[0.925 0.914 0.847]); set(handles.porcion_push,'Background',[0.925 0.914 0.847]); % set(handles.imagen_push,'BackgroundColor',[0.925 0.914 0.847]) set(handles.naturales_push,'Background',[0.925 0.914 0.847]); set(handles.normalizada_push,'Background',[0.925 0.914 0.847]); set(handles.porcentaje_push,'Background',[0.925 0.914 0.847]); % set(handles.imagenf_push,'BackgroundColor',[0.925 0.914 0.847]); set(handles.guardar1_push,'BackgroundColor',[0.925 0.914 0.847]); set(handles.guardarf_push,'BackgroundColor',[0.925 0.914 0.847]); set(handles.maxtr_text,'String',0); set(handles.mintr_text,'String',0); set(handles.mediatr_text,'String',0); set(handles.medianatr_text,'String',0); set(handles.desvtr_text,'String',0); set(handles.arear_text,'String',0); set(handles.potenciar_text,'String',0); set(handles.maxfr_text,'String',0); set(handles.minfr_text,'String',0); set(handles.canaltres_popup,'Value',1); set(handles.canalt_popup,'Value',1); set(handles.canalfres_popup,'Value',1); set(handles.canalf_popup,'Value',1); %Cada vez que se leen los datos, se limpian las imágenes y en su lugar %colocamos un fondo A=imread('logo','jpeg'); axes(handles.dominio_temporal) set(handles.dominio_temporal,'NextPlot','new'); image(A); legend off xlabel('');ylabel('');title('') set(handles.dominio_temporal,'YDir','reverse'); set(handles.dominio_temporal,'XTick',[]); set(handles.dominio_temporal,'visible','on'); set(handles.dominio_temporal,'YTick',[]); set(handles.dominio_temporal,'YtickLabel',[]); axes(handles.dominio_frecuencial) set(handles.dominio_frecuencial,'NextPlot','new'); image(A); legend off xlabel('');ylabel('');title('') set(handles.dominio_frecuencial,'YDir','reverse'); set(handles.dominio_frecuencial,'XTick',[]); set(handles.dominio_frecuencial,'visible','on'); set(handles.dominio_frecuencial,'YTick',[]); set(handles.dominio_frecuencial,'YtickLabel',[]); guidata(hObject,handles) else warndlg('AVISO: No se va a realizar ningún filtrado','AVISO'); end else errordlg('ERROR: Antes de realizar un Filtrado debe leer los datos originales','ERROR') end % --- Executes on button press in figurat_push. function figurat_push_Callback(hObject, eventdata, handles) % hObject handle to figurat_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Cada vez que pintamos una imagen en los ejes, también vamos a %crear un figure para poder posteriormente almacenar la imagen en %bmp vemos = []; v=[]; x2=[]; y2=[]; yComp=[]; visuca = handles.visutcanales; if (visuca-2) <= handles.canales if get(handles.original_push,'BackgroundColor')==[0 0 1] h1 = figure; a1 = axes; plot(handles.X,handles.Y(:,visuca)) title('Datos Originales') xlabel('t (s)') if visuca==1 ylabel('Temperatura (ºC)') vemos = [vemos;'Temperatura']; elseif visuca==2 ylabel('Humedad (%)') vemos = [vemos;'Humedad']; else ylabel('Magnitud (V)') vemos = [vemos;strcat('Canal:',num2str(visuca-2))]; end legend(vemos) handles.a1=a1; handles.h1=h1; guidata(hObject,handles) elseif get(handles.filtrada_push,'BackgroundColor')==[0 0 1] h2 = figure; a2 = axes; plot(handles.Xb(:,visuca),handles.Yb(:,visuca)) title('Datos Filtrados') xlabel('t (s)') if visuca==1 ylabel('Temperatura (ºC)') vemos = [vemos;'Temperatura']; elseif visuca==2 ylabel('Humedad (%)') vemos = [vemos;'Humedad']; else ylabel('Magnitud (V)') vemos = [vemos;strcat('Canal:',num2str(visuca-2))]; end legend(vemos) handles.a2=a2; handles.h2=h2; guidata(hObject,handles) elseif get(handles.orifil_push,'BackgroundColor')==[0 0 1] h3 = figure; a3 = axes; plot(handles.X,handles.Y(:,visuca),'r',... handles.Xb(:,visuca),handles.Yb(:,visuca),'b') xlabel('t (s)') if visuca==1 ylabel('Temperatura (ºC)') vemos = [vemos;'Temperatura']; elseif visuca==2 ylabel('Humedad (%)') vemos = [vemos;'Humedad']; else ylabel('Magnitud (V)') vemos = [vemos;strcat('Canal:',num2str(visuca-2))]; end title(strcat('Datos Originales + Datos Filtrados de ',... vemos)) legend('Original','Filtrada') handles.a3=a3; handles.h3=h3; guidata(hObject,handles) elseif get(handles.porcion_push,'BackgroundColor')==[0 0 1] h4 = figure; a4 = axes; yComp=handles.yComp; x2=handles.x2; y2=handles.y2; if isempty(yComp)==1 plot(x2,y2,'r') xlabel('t(s)') if visuca==1 ylabel('Temperatura (ºC)') title(strcat('Porción de señal seleccionada de Temperatura',... '(Aprox.trapezoidal)')) elseif visuca==2 ylabel('Humedad (%)') title(strcat('Porción de señal seleccionada de Humedad',... '(Aprox.trapezoidal)')) else ylabel('Magnitud (V)') title(strcat('Porción de señal seleccionada del canal',... num2str(visuca-2),'(Aprox.trapezoidal)')) end else plot(x2,y2,'r',x2,yComp,'b+:') legend('S. Original',strcat('S. Reconstruida',... '(orden',num2str(handles.orden),')')) xlabel('t (s)') if visuca==1 ylabel('Temperatura (ºC)') title(strcat('Porcion seleccionada y reconstruida',... ' con el pol. de interpolacion de Temperatura')) elseif visuca==2 ylabel('Humedad (%)') title(strcat('Porcion seleccionada y reconstruida',... ' con el pol. de interpolacion de Humedad')) else ylabel('Magnitud (V)') title(strcat('Porcion seleccionada y reconstruida',... ' con el pol. de interpolacion del canal',num2str(visuca-2))) end end handles.a4 = a4; handles.h4 = h4; else errordlg('ERROR: Primero debe seleccionar una imagen','ERROR') end end % --- Executes on button press in figuraf_push. function figuraf_push_Callback(hObject, eventdata, handles) % hObject handle to figuraf_push (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) vemos = []; visuca = []; f = []; v =[]; visuca = handles.visufcanales; if (visuca-2)<=handles.canales % n = length(visuca); % for i=1:2:n % v=[v,(visuca(i))]; % end f=(0:handles.num_puntos/2-1)/(handles.tmuestreo*handles.num_puntos); end if get(handles.naturales_push,'BackgroundColor')==[0 0 1] %Cada vez que pintamos una imagen en los ejes, también vamos a %crear un figure para poder posteriormente almacenar la imagen en %bmp h5 = figure; a5 = axes; plot(f,handles.Pyy(1:handles.num_puntos/2,visuca)) hold on title('Densidad espectral de Potencia') xlabel('f (Hz)') ylabel('Densidad espectral de Potencia') if visuca==1 vemos=[vemos;'Temperatura']; elseif visuca==2 vemos=[vemos;'Humedad']; else vemos=[vemos;strcat('Canal:',num2str(visuca-2))]; end legend(vemos) handles.a5=a5; handles.h5=h5; elseif get(handles.normalizada_push,'BackgroundColor')==[0 0 1] h6 = figure; a6 = axes; plot(f,handles.PyyNorm(1:handles.num_puntos/2,visuca)) hold on title('Densidad espectral de potencia normalizada') xlabel('f (Hz)') ylabel('Dens. Espectral de Potencia (normalizada)') if visuca==1 vemos=[vemos;'Temperatura']; elseif visuca==2 vemos=[vemos;'Humedad']; else vemos=[vemos;strcat('Canal:',num2str(visuca-2))]; end legend(vemos) hold off handles.h6 = h6; handles.a6 = a6; elseif get(handles.porcentaje_push,'BackgroundColor')==[0 0 1] h7 = figure; a7 = axes; plot(f,handles.PyyPorc(1:handles.num_puntos/2,visuca)) hold on title('Porcentaje de Potencia con respecto al total') xlabel('f(Hz)') ylabel('Dens. Espectral de Potencia (%)') if visuca==1 vemos=[vemos;'Temperatura']; elseif visuca==2 vemos=[vemos;'Humedad']; else vemos=[vemos;strcat('Canal:',num2str(visuca-2))]; end legend(vemos) hold off handles.h7=h7; handles.a7=a7; else errordlg('ERROR: Primero debe seleccionar una imagen','ERROR'); end e-REdING. Biblioteca de la Escuela Superior de Ingenieros de Sevilla.


DESARROLLO Y PUESTA EN FUNCIONAMIENTO DE UN SISTEMA DE MONITORIZACIÓN MÚLTIPLE DE MAGNITUDES BIOFÃSICAS

: Lozano Sánchez, Mª Carmen
: Ingeniería Telecomunicación
Contenido del proyecto: