Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eszmw committed Sep 13, 2023
0 parents commit 7177672
Show file tree
Hide file tree
Showing 186 changed files with 736 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
*.fig binary
*.mat binary
*.mdl binary diff merge=mlAutoMerge
*.mdlp binary
*.mexa64 binary
*.mexw64 binary
*.mexmaci64 binary
*.mlapp binary linguist-language=MATLAB
*.mldatx binary
*.mlproj binary
*.mlx binary merge=mlAutoMerge linguist-language=MATLAB
*.p binary
*.sfx binary
*.sldd binary
*.slreqx binary merge=mlAutoMerge
*.slmx binary merge=mlAutoMerge
*.sltx binary
*.slxc binary
*.slx binary merge=mlAutoMerge
*.slxp binary

## Other common binary file types
*.docx binary
*.exe binary
*.jpg binary
*.pdf binary
*.png binary
*.xlsx binary

# Ignore HTML

*.html linguist-detectable=false
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# List of untracked files to ignore

# Autosave files
*.asv
*.m~
*.autosave
*.slx.r*
*.mdl.r*

# MATLAB Drive
*.MATLABDriveTag

# Derived content-obscured files
*.p

# Compiled MEX files
*.mex*

# Packaged app and toolbox files
*.mlappinstall
*.mltbx

# Deployable archives
*.ctf

# Generated helpsearch folders
helpsearch*/

# Code generation folders
slprj/
sccprj/
codegen/

# Cache files
*.slxc

# Cloud based storage dotfile
.MATLABDriveTag
Binary file added Apps/ComplexFourierSeries.mlapp
Binary file not shown.
140 changes: 140 additions & 0 deletions Apps/DraggablePoint2D.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
classdef DraggablePoint2D
%DRAGGABLEPOINT
% Constructor syntax:
% DraggablePoint(x0,y0)
% DraggablePoint(ax,x0,y0)
% DraggablePoint(ax,x0,y0,moveFunc)
% DraggablePoint(ax,x0,y0,moveFunc,axisRestriction)
%
% x0,y0: single value coordinate pair
% ax: axis handle where the point will be created
% func: handle of a function to be executed when a point is moved,
% the function should take two inputs: x,y, the current
% location of the point
% axisRestriction: restrict motion to an axis:
% 0 (no restriction), 1 (only x), 2 (only y)
%
% Suggestions:
% 1. Set the axis mode to manual when using the draggable point
%
% Interactions with other objects:
% 1. This code automatically sets the axes to manual mode during
% dragging. Afterwards, it is reset.
% 2. This code creates a point on the axes, the handle is stored in
% the object
%
%

properties
lineHandle
funcHandle = [];
restrictToAxis = 0; %Set to 1 for only x-axis motion and 2 for only y-axis motion
end

methods

function obj = DraggablePoint2D(in1,in2,in3,in4,in5)
%DRAGGABLEPOINT constructor. Use either:
% DraggablePoint(x0,y0)
% DraggablePoint(ax,x0,y0)
% DraggablePoint(ax,x0,y0,moveFunc)

if nargin == 2
obj.lineHandle = plot(gca,in1,in2,'o');
elseif nargin == 3
obj.lineHandle = plot(in1,in2,in3,'o');
elseif nargin == 4
obj.lineHandle = plot(in1,in2,in3,'o');
obj.funcHandle = in4;
elseif nargin == 5
obj.lineHandle = plot(in1,in2,in3,'o');
obj.funcHandle = in4;
obj.restrictToAxis = in5;
else
error("Incorrect number of inputs. Use on of the default syntaxes.")
end

% Set the callback after the line object has been created
obj.lineHandle.ButtonDownFcn = @obj.plotClick;
end

function plotClick(obj,src,event)
% Turn off all interactions while dragging is under way
pan(src.Parent,'off')
zoom(src.Parent,'off')
rotate3d(src.Parent,'off')
brush(src.Parent,'off')

% Temporarily set the mode to manual
origModes = {obj.lineHandle.Parent.XLimMode, obj.lineHandle.Parent.YLimMode};
obj.lineHandle.Parent.XLimMode = "manual";
obj.lineHandle.Parent.YLimMode = "manual";

% Handle clicks on the plot objects
set(src,"Selected","on")
set(gcbf,"WindowButtonMotionFcn",{@obj.objMove,src})
set(gcbf,"WindowButtonUpFcn",{@obj.objStop,src,origModes})
end

% Moves an object around the plot (used to move the poles/zeros)
function objMove(obj,src,event,plotSrc)
% Get the current point
currentPoint = plotSrc.Parent.CurrentPoint;
x = currentPoint(1,1);
y = currentPoint(1,2);

% Do not allow the object to move outside the window
if(~(obj.restrictToAxis == 2))
xlims = plotSrc.Parent.XLim;
if(x > xlims(2))
x = xlims(2);
elseif (x < xlims(1))
x = xlims(1);
end
plotSrc.XData = x;
end
if(~(obj.restrictToAxis == 1))
ylims = plotSrc.Parent.YLim;
if(y > ylims(2))
y = ylims(2);
elseif(y < ylims(1))
y = ylims(1);
end
plotSrc.YData = y;
end

% Execute the function handle
if(~isempty(obj.funcHandle))
obj.funcHandle(x,y)
end

% This gives time for the graph to update and is faster than
% drawnow, because it doesn't update the UI, only the plot
pause(0)
end

% Stop moving the object around
function objStop(obj,src,event,plotSrc,origModes)
obj.objMove(src,event,plotSrc);
% remove the callbacks and unselect
set(gcbf,"WindowButtonMotionFcn","")
set(gcbf,"WindowButtonUpFcn","")
set(plotSrc,"Selected","off")

% Update the mode
obj.lineHandle.Parent.XLimMode = origModes{1};
obj.lineHandle.Parent.YLimMode = origModes{2};

% Update the plot/UI
drawnow
end

% Retrieve the position of the object
function [x,y] = getPos(obj)
x = obj.lineHandle.XData;
y = obj.lineHandle.YData;
end

end
end

Binary file added Apps/InteractiveFourierSeries.mlapp
Binary file not shown.
Binary file added Apps/MagnitudePhase.mlapp
Binary file not shown.
Binary file added Apps/SinCosSeries.mlapp
Binary file not shown.
Binary file added Data/Anote.mp3
Binary file not shown.
Binary file added Data/Dnote.mp3
Binary file not shown.
Binary file added Data/Enote.mp3
Binary file not shown.
Binary file added Data/SynthesizedSound.mp4
Binary file not shown.
Binary file added Data/note1.mp3
Binary file not shown.
Binary file added Data/note2.mp3
Binary file not shown.
Binary file added Data/note3.mp3
Binary file not shown.
Binary file added Data/note4.mp3
Binary file not shown.
Binary file added Data/note5.mp3
Binary file not shown.
2 changes: 2 additions & 0 deletions FourierAnalysis.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<MATLABProject xmlns="http://www.mathworks.com/MATLABProjectFile" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"/>
Binary file added Images/ComplexSeriesApp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/ComplexSeriesCover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/DFTCover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/FSC-Setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/FSC-Setup2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/FSC-Soln.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/FSC-labeled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/FourierSeriesApp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/FourierSeriesCover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/FourierTransformCover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/MagPhaseApp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/SCS-Setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/SCS-Setup2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/SinCosSeriesApp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/add-ons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added InteractiveExamples/FourierCompleja.mlx
Binary file not shown.
Binary file added InteractiveExamples/FourierDiscreta.mlx
Binary file not shown.
Binary file added InteractiveExamples/SerieDeFourier.mlx
Binary file not shown.
Binary file added InteractiveExamples/TransformadaDeFourier.mlx
Binary file not shown.
27 changes: 27 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2023, The MathWorks, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution
* Neither the name of the The MathWorks, Inc. nor the names
of its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Binary file added Labs/Lab1_SerieDeFourier.mlx
Binary file not shown.
Binary file added Labs/Lab2_SerieDeFourierCompleja.mlx
Binary file not shown.
Binary file added Labs/Lab3_TransformadaFourier.mlx
Binary file not shown.
Binary file added Labs/Lab4_DFT_es.mlx
Binary file not shown.
11 changes: 11 additions & 0 deletions Navigation/LabStartup.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
%% This script initializes the lab
% This file automatically runs when you open the project

%% Show the info script
if isMATLABReleaseOlderThan("R2023b")
open("Navigacion2.mlx")
else
open("Navigacion.mlx")
end


Binary file added Navigation/Navigacion.mlx
Binary file not shown.
Binary file added Navigation/Navigacion2.mlx
Binary file not shown.
12 changes: 12 additions & 0 deletions Navigation/OpenOverview.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function OpenOverview
curFile = matlab.desktop.editor.getActive;
if isMATLABReleaseOlderThan("R2023b")
open("Navigacion2.mlx")
else
open("Navigacion.mlx")
end
navFile = matlab.desktop.editor.getActive;
if string(curFile.Filename) ~= string(navFile.Filename)
close(curFile)
end
end
130 changes: 130 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Análisis de Fourier
[![Ver Análisis de Fourier en File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/XXXX-fourier-analysis_es) o [![Abrir en MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Fourier-Analysis_es&project=FourierAnalysis.prj)

**Módulo Curricular**
_Creado con R2021b. Compatible con R2021b y versiones posteriores._

## Descripción ##
Este módulo curricular enseña el análisis de Fourier utilizando [live scripts](https://www.mathworks.com/products/matlab/live-editor.html) y [aplicaciones de MATLAB&reg;](https://www.mathworks.com/products/matlab/app-designer.html) interactivas. El módulo se enseña desde una perspectiva de procesamiento de señales, adecuada para un curso introductorio de señales y sistemas. En la primera lección, los estudiantes utilizan aplicaciones para visualizar series de Fourier y desarrollar intuición sobre el dominio de frecuencia. En lecciones posteriores, los estudiantes estudian series de Fourier complejas, transformadas de Fourier y transformadas de Fourier discretas. A medida que los estudiantes avanzan, pasan de utilizar aplicaciones a escribir su propio código para analizar señales. A lo largo del módulo, los estudiantes aplican técnicas de Fourier para analizar señales de audio grabadas.

Cada tema incluye un laboratorio que aplica los conceptos enseñados en la lección. Las soluciones están disponibles a solicitud del instructor. Si desea solicitar soluciones o tiene alguna pregunta, comuníquese con el <a href="mailto:[email protected]">equipo de enseñanza en línea de MathWorks.</a>

Comience con el módulo curricular de Análisis de Fourier descargando y descomprimiendo el repositorio. Luego, haga doble clic en el archivo .prj del proyecto dentro de MATLAB. A partir de ahí, puede seguir las instrucciones de la página de inicio para comenzar con los ejemplos y laboratorios.

Este módulo ha sido traducido automáticamente del inglés.

## Detalles ##

<table style="vertical-align:top">
<tr>
<th>Módulo</th>
<th>Objetivos de Aprendizaje</th>
</tr>
<tr>
<td>
<b>1. Series de Fourier</b><br><br>
<img width="500" src="./Images/FourierSeriesCover.png" style="margin:10px" >
</td>
<td>
<ul>
<li>Comparar señales en los dominios de tiempo y frecuencia.</li>
<li>Analizar señales de audio en el dominio de frecuencia.</li>
<li>Visualizar modos de series de Fourier.</li>
<li>Describir cómo se representa el desplazamiento de fase en una serie de Fourier.</li>
<li>Discutir magnitud y fase.</li>
</ul>
</td>
</tr>
<tr>
<td>
<b>2. Series de Fourier Complejas</b><br><br>
<img width="500" src="./Images/ComplexSeriesCover.png" style="margin:10px" >
</td>
<td>
<ul>
<li>Recordar la fórmula de Euler.</li>
<li>Comparar series de Fourier complejas y reales.</li>
<li>Visualizar series de Fourier complejas.</li>
<li>Construir funciones utilizando series de Fourier complejas.</li>
</ul>
</td>
</tr>
<tr>
<td>
<b>3. Transformada de Fourier</b><br><br>
<img width="500" src="./Images/FourierTransformCover.png" style="margin:10px" >
</td>
<td>
<ul>
<li>Comparar series de Fourier con la transformada de Fourier.</li>
<li>Evaluar la transformada de Fourier de una función.</li>
<li>Representar señales utilizando funciones continuas.</li>
<li>Discutir ondas portadoras y modulación.</li>
<li>Comparar funciones en los dominios de tiempo y frecuencia utilizando la transformada de Fourier.</li>
</ul>
</td>
</tr>
<tr>
<td>
<b> 4. Transformada Discreta de Fourier</b><br><br>
<img width="500" src="./Images/DFTCover.png" style="margin:10px" >
</td>
<td>
<ul>
<li>Graficar la transformada discreta de Fourier (DFT).</li>
<li>Usar la función fft para calcular la DFT.</li>
<li>Relacionar la DFT con la transformada de Fourier.</li>
<li>Aplicar la DFT para analizar una señal de audio.</li>
</ul>
</td>
</tr>
</table>

## Aplicaciones ##

<table style="vertical-align:top">
<tr>
<td>
Series de Seno y Coseno <br>

<img width="200" src="./Images/SinCosSeriesApp.png" style="margin:10px">
</td>
<td>
Series de Fourier<br>

<img width="200" src="./Images/FourierSeriesApp.png" style="margin:10px">
</td>
<td>
Magnitud y Fase<br>

<img width="200" src="./Images/MagPhaseApp.png" style="margin:10px">
</td>
<td>
Series de Fourier Complejas<br>

<img width="200" src="./Images/ComplexSeriesApp.png" style="margin:10px">
</td>
</tr>
</table>

## Preparación sugerida ##

[MATLAB Onramp](https://matlabacademy.mathworks.com/details/matlab-onramp/gettingstarted) - un tutorial introductorio gratuito de dos horas que enseña los conceptos esenciales de MATLAB.

## Productos ##

MATLAB, Symbolic Math Toolbox&trade;

## Licencia ##

La licencia para este módulo está disponible en el archivo [LICENSE.md](LICENSE.md) en este repositorio de GitHub.

## Recursos para educadores ##

* [Featured Courseware](https://www.mathworks.com/academia/courseware/course-materials.html)
* [Enseñar con MATLAB y Simulink](https://www.mathworks.com/academia/educators.html)
* [MATLAB Grader](https://www.mathworks.com/products/matlab-grader.html)

## ##

_Copyright 2023 The MathWorks, Inc._
Loading

0 comments on commit 7177672

Please sign in to comment.