marcoshuck

Magnitud y fase (TD)

Dec 15th, 2016
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.57 KB | None | 0 0
  1. %{
  2. Análisis de Señales y Sistemas - TP Laboratorio Nº 3
  3. Función FTRANSFD - Grupo 6
  4. Argumentos:
  5.     - x: Señal de entrada
  6.     - n: Variable independiente
  7.     - w: Frecuencia angular
  8. Retorna:
  9.     - Xabs: Magnitud de la señal
  10.     - Xarg: Fase de la señal
  11. Repositorio disponible en: https://github.com/marcoshuck/matlab-tp3-asys
  12. Realizado por Huck Marcos A. y Castelluci Leandro E.
  13. %}
  14.  
  15. function[Xabs, Xarg] = FTRANSFD(x, n, w)
  16.     fi = exp(-1i*n);
  17.     for p=1:length(w)
  18.         Xw(p) = sum(x.*(fi.^w(p)));
  19.     end
  20.     Xabs = abs(Xw);
  21.     Xarg = angle(Xw);
  22. end
Advertisement