Documentos de Académico
Documentos de Profesional
Documentos de Cultura
como dato general tendremos la fase de la señal, con un ángulo recto que
nos servirá para graficar la señal
los datos para la señal de onda, crearemos un vector llamado lims donde
almacenará los datos expuestos, en una nueva variable crearemos una
matriz x,y donde almacenaremos datos en 2D, creando una cuadricula con
los datos de lims, con la función ndgrid, creamos la cuadrícula en 2D.
en xp creamos nuestra señal.
% sine wave initializations
lims = [-91 91];
[x,y] = ndgrid(lims(1):lims(2),lims(1):lims(2));
xp = x*cos(sinephas) + y*sin(sinephas);
clim = [0 1000];
% setup plot
figure(1), clf
subplot(121)
imageh = imagesc(rand(length(x)));
axis square, axis off, axis xy
title('Space domain')
subplot(222)
amph = imagesc(rand(length(x)));
axis square, axis off, axis xy
set(gca,'xlim',[lims(2)-30 lims(2)+30],'ylim',[lims(2)-30
lims(2)+30],'clim',clim)
title('Amplitude spectrum')
subplot(224)
phaseh = imagesc(rand(length(x)));
axis square, axis off, axis xy
set(gca,'xlim',[lims(2)-30 lims(2)+30],'ylim',[lims(2)-30 lims(2)+30])
title('Phase spectrum')
powr2 = abs(imgX);
phas2 = angle(imgX);
% update plots
set(imageh,'CData',img);
set(amph ,'CData',powr2);
set(phaseh,'CData',phas2);
pause(.2)
end
Next, when plotting the frequencies, with the linspace function that
generates a linearly spaced vector, we specify the vector of the
sinusoidal frequencies. With arbitrary numbers.
In the sinefreq variable, we will save a vector with fifty data that will
range from 0.0001 to 0.2,as a general data we will have the phase of the
signal, with a right angle that will serve to graph the signal:
\begin{figure} [h!]
\centering
\includegraphics[scale=0.3]{a.jpg}
\caption{}
\end{figure}
\end{methodology}
A continuación, al graficar las fases, con la función linspace que genera
un vector espaciado linealmente, especificamos el vector de las phases
sinusoidales.
En la variable sinefreq le daremos un valor de 0.05 unidades arbitrarias.
% setup plot
figure(2), clf
subplot(121)
imageh = imagesc(rand(length(x)));
axis square, axis off, axis xy
title('Space domain')
subplot(222)
amph = imagesc(rand(length(x)));
axis square, axis off, axis xy
set(gca,'xlim',[lims(2)-30 lims(2)+30],'ylim',[lims(2)-30
lims(2)+30],'clim',clim)
title('Amplitude spectrum')
subplot(224)
phaseh = imagesc(rand(length(x)));
axis square, axis off, axis xy
set(gca,'xlim',[lims(2)-30 lims(2)+30],'ylim',[lims(2)-30 lims(2)+30])
title('Phase spectrum')
En este caso solo jugaremos con las señales en el ciclo ‘for’. Para las
gráficas, mostramos cada señal individualmente. Con CData se definen datos de imagen
indexados. Cada elemento define un color para un píxel de la imagen. Y con set guardamos la
imagen en la propiedad CData como podemos observar a continuación.
% update plots
set(imageh,'CData',img);
set(amph ,'CData',powr2);
set(phaseh,'CData',phas2);
pause(.2)
end
Para las gráficas, mostramos cada señal individualmente. Con CData se definen datos de imagen
indexados. Cada elemento define un color para un píxel de la imagen. Y con set guardamos la
imagen en la propiedad CData como podemos observar a continuación.
axes(handles.axes9)
subplot(244)
plot(xp)
axis square, axis off, axis xy
axes(handles.axes7)
subplot(245)
plot(img)
axis square, axis off, axis xy
axes(handles.axes4)
subplot(246)
plot(powr2)
axis square, axis off, axis xy
%% physical location
centlocs = linspace(-80,80,50);
% setup plot
figure(3), clf
subplot(121)
imageh = imagesc(rand(length(x)));
axis square, axis off, axis xy
title('Space domain')
subplot(222)
amph = imagesc(rand(length(x)));
axis square, axis off, axis xy
title('Amplitude spectrum')
set(gca,'clim',[0 200])
subplot(224)
phaseh = imagesc(rand(length(x)));
set(gca,'xlim',[lims(2)-30 lims(2)+30],'ylim',[lims(2)-30 lims(2)+30])
axis square, axis off, axis xy
title('Phase spectrum')