Sin categoría

Autofunciones de sistemas LTI analógicos

Sea S un sistema LTI (lineal e invariante en el tiempo) analógico cualquier y sea h(t) su respuesta impulsiva. Considérese que la señal de entrada de S es una señal exponencial compleja de la forma siguiente:

Allí donde s0 es una constante compleja (s complejos)

Al calcular la señal de salida de S como resultado de la convolución entre x(t)  y h(t), se observa lo siguiente:

En consecuencia:

Allí donde, independientemente de si h(t) es una señal real o compleja, H(s0)  es un valor constante (no depende de t) y, en general, complejo (puesto que s0 complejos).

Así pues se observa que la salida de un sistema LTI analógico cualquier ante cualquier señal exponencial compleja de la forma expresada en la ecuación (1) es igual a esa misma señal exponencial compleja multiplicada por una constante. En concreto, por la señal denominada en la ecuación (2). Se observa además que dicha constante depende únicamente de h(t) (la respuesta impulsiva del sistema) y del valor de s0.

En este punto enunciamos el teorema de las autofunciones de los sistemas LTI analógicos:

En primer lugar conviene notar que la constante s0 tiene parte real y parte imaginaria:

Por lo tanto, vemos que las autofunciones de los sistema LTI analógicos pueden ser vistas como el resultado del producto de una señal exponencial real y una señal exponencial compleja:

Allí donde,  σ0 y Ω0 son constantes reales (σ0 y Ω0 )

Y en segundo lugar, puesto que todo sistema LTI es, por definición, lineal e invariante en el tiempo, ya podemos extraer la consecuencia más inmediata, pero de enorme importancia, del teorema de las autofunciones. Sea una combinación lineal arbitraria de M exponenciales complejas:

La salida de cualquier sistema LTI analógico S ante una entrada de la forma expresada en la ecuación anterior, es otra combinación lineal de las mismas exponenciales complejas:

Donde H(sk) se calcula a partir de h(t), la respuesta impulsiva de S, del siguiente modo:

A continuación se ilustra la utilidad práctica de las autofunciones.

Ejemplo 1

Sea S un sistema LTI analógico y sea h(t) su respuesta impulsiva:

Se pide calcular la salida del sistema S ante la siguiente señal de entrada:

Respuesta:

Para aplicar el teorema de autofunciones expresamos como una combinación lineal de exponenciales complejas:

Aplicando la ecuación (4), la salida es la siguiente:

Procedemos a calcular cada uno de los factores H(i):

Por otra parte:

Además:

Por lo tanto:

Finalmente la expresión definitiva para y(t) es:

En consecuencia:

Fuentes:

  1. Fundamentos_de_Señales_y_Sistemas_usando la Web y Matlab
  2. Oppenheim – Señales y Sistemas
  3. Análisis de Sistemas Lineales Asistido con Scilab – Un Enfoque desde la Ingeniería Eléctrica.
  4. Amplificador Operacional
  5. CIRCUITO TRANSFORMADO DE LAPLACE
  6. DINAMICA CIRCUITOS
  7. INTRODUCCION A LAS SENALES Y SISTEMAS
  8. RESPUESTA EN FRECUENCIA
  9. TRANSFORMACION DE LAPLACE
  10. Control Systems Engineering, Nise
  11. Convolución LTI

Te puede interesar:

Escrito por Prof. Larry Francis Obando – Technical Specialist – Educational Content Writer – Twitter: @dademuch

Se hacen trabajos, se resuelven ejercicios!!

WhatsApp:  +34633129287  Atención Inmediata!!

Mentoring Académico / Emprendedores / Empresarial

Copywriting, Content Marketing, Tesis, Monografías, Paper Académicos, White Papers (Español – Inglés)

Escuela de Ingeniería Electrónica de la Universidad Simón Bolívar, USB Valle de Sartenejas.

Escuela de Ingeniería Eléctrica de la Universidad Central de Venezuela, UCV CCs

Escuela de Turismo de la Universidad Simón Bolívar, Núcleo Litoral.

Contacto:  Caracas, Quito, Guayaquil, España: Tlf. +34633129287.

WhatsApp: +34 633129287

Twitter: @dademuch

FACEBOOK: DademuchConnection

email: dademuchconnection@gmail.com

Sin categoría

Digital Filters – FIR and IIR Filters – MA Filters – Examples

Filter is a generic name that means a linear time-invariant system designed for a specific job of frequency selection or frequency discrimination. Hence discrete-time LTI systems are also called digital filters. There are two types of digital filters: FIR Filters and IIR Filters.

Preliminaries

An LTI discrete system can also be described by a linear constant coefficient difference equation of the form:

La imagen tiene un atributo ALT vacío; su nombre de archivo es image-75.png

This equation describes a recursive approach for computing the current output, given the input values and previously computed output values. In practice, this equation is computed forward in time, from n=-∞ to n=+∞. Therefore, another form of equation (1) is:

La imagen tiene un atributo ALT vacío; su nombre de archivo es image-49.png
FIR Filter

If the unit impulse response of an LTI system is of finite duration, the system is called a finite-duration impulse response (or FIR) filter.  Hence for a FIR filter h[n]=0 for n<n1 and for n>n2. The following part of the difference equation (2) describes a causal FIR filter:

Furthermore, h[0]=bo , h[1]=b1 ,… h[M]=bM . while all the other h[n]’s are 0. FIR filters are also called non-recursive or moving average (MA) filters. In Matlab FIR filters are represented either as impulse response values {h[n]} or as difference equation coefficients {bm} and {a0 =1}. Therefore, to implement FIR filters in Matlab, we can use either the conv(x,h) function, or the filter(b,1,x) function. See the following example:

Example 1. 

Let the following rectangular pulse x[n] be an input to an LTI system with impulse response h[n]:

Determine the output y[n] of the system.

Solution:

In Elementary sequences we have implemented the function stepseq for plotting the unit step function in discrete time, or any combination as example 1. Next Script allows plotting x[n].

n=[0:40];
x=stepseq(0,0,40)-stepseq(10,0,40);
stem(n,x)
xlabel(‘n’); ylabel(‘x[n]’)

Figure 1. Input sequence x[n], example 1.

Next Script allows plotting h[n].

n=[0:40];
h=(0.9).^n;
stem(n,h)
xlabel(‘n’); ylabel(‘h[n]’)

Figure 2. Impulse response h[n] for system in example 1.

Now, we use conv Matlab function to determine y[n]:

y=conv(x,h);
n=[0:80];
stem(n,y);
xlabel(‘n’); ylabel(‘y[n]’)

Figure 3. Output sequence y[n]=x[n]*h[n] for example 1.

Another approach is by using the filter function:

n=[0:40];
x=stepseq(0,0,40)-stepseq(10,0,40);
h=(0.9).^n;
y=filter(h,1,x);
stem(n,y)
xlabel(‘n’); ylabel(‘y[n]’)
grid

What yields:

Figure 4. Output sequence y[n]=x[n]*h[n] for example 1.

There is a difference in the outputs of these two implementations that should be noted. As you can see in Figure 3, the output sequence from conv(x,h) function has a longer length than both x[n] and h[n] sequences. On the other hand, the output sequence from the filter(h,1,x) function in Figure 4 has exactly the same length as the input x[n] sequence. In practice, the use of the filter function is encouraged.

Watch out: The filter function can be used to compute the convolution indirectly. That was possible because of the impulse response in example 1 was a one-side exponential sequence for wich we could determine a difference equation representation. Not all infinite-lenght impulse responses can be converted into difference equations.

IIR Filter

If the impulse response of an LTI system is of infinite duration, then the system is called an infinite-duration impulse response (or IIR) filter. The following part of the difference equation (2):

Describes a recursive filter in which the output y[n] is recursively computed from its previously computed values and is called an autoregressive (AR) filter. The impulse response of such filter is of infinite duration and hence it represents and IIR filter. The general equation (2) also describes an IIR filter. It has two parts: an AR part and a MA part. Such an IIR filter is called an autoregressive moving average, or an ARMA filter. In Matlab, IIR filters are described by the difference equation coefficients {bm} and {ak} and are implemented by the filter(b,a,x) function. See the following example:

Example 2

Given the following difference equation:

  1. Calculate and plot the impulse response h[n] at n=-20,…,100
  2. Calculate and plot the unit step response s[n] at n=-20,…,100
  3. Is the system specified by h[n] stable?

Solution:

  1. To determine h[n] we use the following script:

n=[-20:120];
a=[1,-1,0.9];
b=[1];
h=impz(b,a,n);
stem(n,h)
grid
xlabel(‘n’); ylabel(‘h[n]’)

The script yields:

Figure 1. Impulse response h[n] for example 1.
  1. 2. To determine s[n] we use the following script:

n=[-20:120];
a=[1,-1,0.9];
b=[1];
x=stepseq(0,-20,120);
s=filter(b,a,x);
stem(n,s)
xlabel(‘n’); ylabel(‘s[n]’);

The script yields:

Figure 2. Step response s[n] for example 1.
  1. Is the system specified by h[n] stable?

From Figure 1 we see that h[n] is practically zero n>120. Hence the sum:

Can be determined with the following script:

sum(abs(h))

This yields:

ans = 14.8785

That is to say:

This result implies that the system is stable. An alternate approach is to use the stability condition of the roots:

z=roots(a);
magz=abs(z)

magz =

0.9487
0.9487

Since the magnitude of both roots are less than one, the system is stable.

Actually, there are two forms of solving a linear constant coefficient difference equation: finding the particular and the homogeneous solutions; finding the zero-input and the zero-state responses. It is by using the z-transform that we can derive a method to obtain both.

Related: Solving discrete-time differential equations with Matlab

Source:

  • Digital Signal Processing Using Matlab, 3erd ed
  • Fundamentos_de_Señales_y_Sistemas_usando la Web y Matlab
  • Oppenheim – Señales y Sistemas
  • Análisis de Sistemas Lineales Asistido con Scilab – Un Enfoque desde la Ingeniería Eléctrica.

You can also be interested in:

Literature review by:

Prof. Larry Francis Obando – Technical Specialist – Educational Content Writer

Exercises are solved!!

WhatsApp:  +34633129287  Inmediate Attention!!

Twitter: @dademuch

Copywriting, Content Marketing, Tesis, Monografías, Paper Académicos, White Papers (Español – Inglés)

Escuela de Ingeniería Electrónica de la Universidad Simón Bolívar, USB Valle de Sartenejas.

Escuela de Ingeniería Eléctrica de la Universidad Central de Venezuela, UCV Caracas.

Escuela de Turismo de la Universidad Simón Bolívar, Núcleo Litoral.

Contacto: España. +34633129287

Caracas, Quito, Guayaquil, Jaén. 

WhatsApp:  +34633129287   

Twitter: @dademuch

FACEBOOK: DademuchConnection

email: dademuchconnection@gmail.com

Sin categoría

Resolver ecuaciones diferenciales en tiempo discreto con Matlab

Un sistema LTI (lineal e invariante en el tiempo) de tiempo discreto puede ser descrito mediante una ecuación diferencial lineal (ó ecuación lineal en diferencias) con coeficientes constantes de la forma:

La ecuación (1) describe un método recursivo para calcular la salida y[n], dado los valores de la entrada x[n] y valores previos de la misma salida y[n]. En la práctica, esta ecuación se calcula hacia adelante en el tiempo, de n=-∞ a n=∞. En consecuencia, otra forma de escribir esta ecuación es:

Una solución para la ecuación (2) puede ser obtenida de la forma:

La parte homogénea yh[n] está dada por:

Donde zk, k=1,…,N son N raíces (también conocidas como frecuencias naturales) de la ecuación característica:

La ecuación característica es importante porque determina la estabilidad del sistema. Si las raíces zk satisfacen la siguiente condición:

Entonces el sistema causal de la ecuación (2) es estable. La solución particular, yp[n], está determinada por la parte derecha de la ecuación (1), para lo cual utilizaremos la transformada z (z-transform) en la determinación de la solución de una ecuación en diferencias.

Matlab solving

Una función llamada filter está disponible en Matlab para resolver Discrete-Time difference equations, dados los valores de la entrada y los coeficientes de la ecuación en diferencias. En su forma más simple la función es invocada por:

y=filter(b,a,x)

Donde b y a son las matrices de los coeficientes de la ecuación (1), y x es la matriz de la secuencia de entrada. Debemos asegurarnos de que el coeficiente a0 no sea igual a cero.

Para determinar y graficar la respuesta al impulso, Matlab además provee la función impz:

h=impz(b,a,n);

Calcula muestras de la respuesta al impulso del filtro en los índices de muestra dados en n con coeficientes de numerador en b y coeficientes de denominador en a.

Ejemplo 1.

Dada la siguiente ecuación en diferencias:

  1. Calculate and plot the impulse response h[n] at n=-20,…,100
  2. Calculate and plot the unit step response s[n] at n=-20,…,100
  3. Is the system specified by h[n] stable?

Solution:

  1. To determine h[n] we use the following script:

n=[-20:120];
a=[1,-1,0.9];
b=[1];
h=impz(b,a,n);
stem(n,h)
grid
xlabel(‘n’); ylabel(‘h[n]’)

The script yields:

Figure 1. Impulse response h[n] for example 1.
  1. 2. To determine s[n] we use the following script:

n=[-20:120];
a=[1,-1,0.9];
b=[1];
x=stepseq(0,-20,120);
s=filter(b,a,x);
stem(n,s)
xlabel(‘n’); ylabel(‘s[n]’);

The script yields:

Figure 2. Step response s[n] for example 1.
  1. Is the system specified by h[n] stable?

From Figure 1 we see that h[n] is practically zero n>120. Hence the sum:

Can be determined with the following script:

sum(abs(h))

This yields:

ans = 14.8785

That is to say:

This result implies that the system is stable. An alternate approach is to use the stability condition of the roots:

z=roots(a);
magz=abs(z)

magz =

0.9487
0.9487

Since the magnitude of both roots are less than one, the system is stable.

Puede estar interesado también en:

Revisión literaria hecha por:

Prof. Larry Francis Obando – Technical Specialist – Educational Content Writer

Se hacen trabajos, se resuelven ejercicios!!

WhatsApp:  +34633129287  Atención Inmediata!!

Twitter: @dademuch

Copywriting, Content Marketing, Tesis, Monografías, Paper Académicos, White Papers (Español – Inglés)

Escuela de Ingeniería Electrónica de la Universidad Simón Bolívar, USB Valle de Sartenejas.

Escuela de Ingeniería Eléctrica de la Universidad Central de Venezuela, UCV CCs

Escuela de Turismo de la Universidad Simón Bolívar, Núcleo Litoral.

Contacto: España. +34633129287

Caracas, Quito, Guayaquil, Jaén. 

WhatsApp:  +34633129287     

Twitter: @dademuch

FACEBOOK: DademuchConnection

email: dademuchconnection@gmail.com

Sin categoría

Solving discrete-time differential equations with Matlab

An LTI discrete system can also be described by a linear constant coefficient difference equation of the form:

This equation describes a recursive approach for computing the current output, given the input values and previously computed output values. In practice, this equation is computed forward in time, from n=-∞ to n=∞. Therefore, another form of this equation is:

A solution to equation (2) can be obtained in the form:

The homogeneous part yh[n] is given by:

Where zk, k=1,…,N are N roots (also called natural frequencies) of the characteristic equation:

This characteristic equation is important in determining the stability of the system. If roots zk satisfy the condition:

Then a casual system described by equation (2) is stable. The particular part of the solution, yp[n], is determined from the right-hand side of equation (1), where we will use z-transform for solving the difference equation.

Matlab solving

A function called filter in available in Matlab to solve Discrete-Time difference equations, given the input and the difference equation coefficients. In its simplest form it is invoked by:

y=filter(b,a,x)

Where b and a are the coefficient arrays from the equation (1), and x is the input sequence array. One must ensure that the coefficient a0 not be zero.

To compute and plot impulse response, Matlab also provides the function impz:

h=impz(b,a,n);

It computes samples of the impulse response of the filter at the sample indices given in n with numerator coefficients in b and denominator coefficients in a.

Example 1.

Given the following difference equation:

  1. Calculate and plot the impulse response h[n] at n=-20,…,100
  2. Calculate and plot the unit step response s[n] at n=-20,…,100
  3. Is the system specified by h[n] stable?

Solution:

  1. To determine h[n] we use the following script:

n=[-20:120];
a=[1,-1,0.9];
b=[1];
h=impz(b,a,n);
stem(n,h)
grid
xlabel(‘n’); ylabel(‘h[n]’)

The script yields:

Figure 1. Impulse response h[n] for example 1.
  1. 2. To determine s[n] we use the following script:

n=[-20:120];
a=[1,-1,0.9];
b=[1];
x=stepseq(0,-20,120);
s=filter(b,a,x);
stem(n,s)
xlabel(‘n’); ylabel(‘s[n]’);

The script yields:

Figure 2. Step response s[n] for example 1.
  1. Is the system specified by h[n] stable?

From Figure 1 we see that h[n] is practically zero n>120. Hence the sum:

Can be determined with the following script:

sum(abs(h))

This yields:

ans = 14.8785

That is to say:

This result implies that the system is stable. An alternate approach is to use the stability condition of the roots:

z=roots(a);
magz=abs(z)

magz =

0.9487
0.9487

Since the magnitude of both roots are less than one, the system is stable.

Actually, there are two forms of solving a linear constant coefficient difference equation: finding the particular and the homogeneous solutions; finding the zero-input and the zero-state responses. It is by using the z-transform that we can derive a method to obtain both.

Finding the particular and the homogeneous solutions

In construction…

Working with initial conditions – The zero-input and the zero-state responses.

In Matlab another form of the function filter can be used to solve for the differential equation, given its initial conditions.

In construction…

Related: Digital Filters – Moving Average Filters

You could be also interested in:

Source:

  • Digital Signal Processing Using Matlab, 3erd ed
  • Fundamentos_de_Señales_y_Sistemas_usando la Web y Matlab
  • Oppenheim – Señales y Sistemas
  • Análisis de Sistemas Lineales Asistido con Scilab – Un Enfoque desde la Ingeniería Eléctrica.

Literature review by:

Prof. Larry Francis Obando – Technical Specialist – Educational Content Writer

Exercises are solved!!

WhatsApp:  +34633129287  Inmediate Attention!!

Twitter: @dademuch

Copywriting, Content Marketing, Tesis, Monografías, Paper Académicos, White Papers (Español – Inglés)

Escuela de Ingeniería Electrónica de la Universidad Simón Bolívar, USB Valle de Sartenejas.

Escuela de Ingeniería Eléctrica de la Universidad Central de Venezuela, UCV Caracas.

Escuela de Turismo de la Universidad Simón Bolívar, Núcleo Litoral.

Contacto: España. +34633129287

Caracas, Quito, Guayaquil, Jaén. 

WhatsApp:  +34633129287   

Twitter: @dademuch

FACEBOOK: DademuchConnection

email: dademuchconnection@gmail.com

Análisis de sistemas de control, Convolución - respuesta al impulso, Procesamiento de señales digitales

Convolución de señales en tiempo discreto – Matlab

La salida y[n] de un sistema lineal e invariante en el tiempo (LTI-system) puede ser determinada mediante la sumatoria siguiente:

La ecuación anterior se denomina Convolución entre las señales discretas x[n] y h[n], donde x[n] es la entrada al sistema y h[n] es la respuesta al impulso del sistema.

Por convención, la convolución entre x[n] y h[n] se expresa mediante al siguiente notación:

Ejemplo 1. 

El pulso rectangular x[n] definido por la siguiente ecuación es la entrada a un sistema LTI con respuesta l impulso h[n]:

Determine la salida y[n] del sistema.

Solucion:

En el link Graficar el escalón unitario hemos diseñado en Matlab la función stepseq para graficar , o cualquier combinación tal como la señal x[n] del ejemplo 1. El siguiente Script permite graficar x[n].

n=[0:40];
x=stepseq(0,0,40)-stepseq(10,0,40);
stem(n,x)
xlabel(‘n’); ylabel(‘x[n]’)

Figure 1. Input sequence x[n], example 1.

Por su parte, el siguiente Script permite graficar h[n].

n=[0:40];
h=(0.9).^n;
stem(n,h)
xlabel(‘n’); ylabel(‘h[n]’)

Figure 2. Impulse response h[n] for system in example 1.

Ahora, utilizamos la función conv del toolbox de Matlab para determinar y[n]:

y=conv(x,h);
n=[0:80];
stem(n,y);
xlabel(‘n’); ylabel(‘y[n]’)

Figure 3. Output sequence y[n]=x[n]*h[n] for example 1.

Otra aproximación es utilizando la función filter (ver Resolver ecuaciones diferenciales en tiempo discreto):

n=[0:40];
x=stepseq(0,0,40)-stepseq(10,0,40);
h=(0.9).^n;
y=filter(h,1,x);
stem(n,y)
xlabel(‘n’); ylabel(‘y[n]’)
grid

Este comando genera:

Figure 4. Output sequence y[n]=x[n]*h[n] for example 1.

Hay una diferencia en los resultados de estas dos implementaciones que debe tenerse en cuenta. Como puede ver en la Figura 3, la secuencia de salida de la función conv(x, h) tiene una longitud mayor que las secuencias x[n] y h[n]. Por otro lado, la secuencia de salida de la función filter(h, 1, x) en la Figura 4 tiene exactamente la misma longitud que la secuencia de entrada x[n]. En la práctica, se recomienda el uso de la función filter.

Nota: la función filter se ha utilizado para calcular la convolución indirectamente. Eso fue posible debido a que la respuesta al impulso en el ejemplo 1 era una secuencia exponencial de un solo lado (sólo definida pra n>=0), para la cual podríamos determinar una representación en forma de ecuación en diferencias. No todas las respuestas de impulso de longitud infinita se pueden convertir en ecuaciones en diferencias.

Convolución analíticamente

También podemos hacer la convolución entre x[n] y h[n] Analíticamente:

Aplicando la ecuación para la convolución obtenemos :

Ahora usamos la expresión para la suma de componentes de una serie geométrica (Serie geométrica):

En consecuencia, la ecuación (1) es equivalente a:

La ecuación (3) tiene la misma forma que la ecuación (2) excepto por el término u(n-k) el cual toma diferentes valores dependiendo de los valores que toman n y k. Existen tres posibilidades para u(n-k) que deben ser evaluadas por separado:

Cas0 1. n<0: Entonces u(n-k)=0 para 0 k 9. Por lo tanto:

Caso 2. En este caso, los valores son distintos de cero y no se superponen. Entonces, en el intervalo 0n<9, u(n-k)=1 para 0kn. Así:

Aplicando la fórmula de la ecuación (2):

Caso 3. En este caso la respuesta al impulso h[n] se superpone parcialmente con x[n]. Así, en el intervalo 9 n, u(n-k)=1 para 0 k 9. En consecuencia:

En el último caso h[n] se superpone completamente a la entrada x[n].

Método gráfico de convolución

Para desarrollar la convolución entre dos señales también podemos utilizar un método gráfico, como en el ejemplo siguiente.

Ejemplo 2

The input signal x[n] to an LTI system with impulse response h[n]:

Determine graphically y[n] through:

La imagen tiene un atributo ALT vacío; su nombre de archivo es null-63.png

Solution:

Sequences x[k] and h[n-k], and the convolution of both signals can be seen as follows:

El método de convolución gráfica anterior involucra los siguientes pasos:

  1. La respuesta al impulso h[k] se invierte en el tiempo (es decir, se refleja sobre el origen) para obtener h[-k]  y posteriormente se desplaza mediante n para formar h[n-k] = h[-(k-n)], que es una función de k con parámetro n;
  2. Las dos secuencias x[k] y h[n-k] se multiplican entre sí para todos los valores de k con n fija en algún valor;
  3. El producto x[k]h[n-k] se suma sobre todas las k para producir una sola muestra de salida y[n];
  4. Los pasos 1 a 3 se repiten a medida que n varía en el intervalo de –infinito a +infinito para producir la salida completa y[n].
Ejemplo 3
Convolution Properties.

Otras propiedades de interés son:

Ante una entrada x[n], la respuesta y[n] de un sistema LTI es:

Se conoce que la respuesta al impulso h[n] del sistema:

Determinar x[n]. Seleccionar la respuesta correcta de las siguientes alternativas:

Respuesta:

Nuestra estrategia será utilizar las siguientes propiedades:

Expresamos la respuesta al impulso en términos de deltas de Dirac desplazados:

Luego, si seleccionamos:

Entonces:

Podríamos demostrar gráficamente que la anterior ecuación coincide con la gráfica para y[n] dada en el enunciado. Por lo tanto, la opción correcta es la letra a). Vamos a demostrarlo con Matlab.

La respuesta al impulso h[n] y la opción a) para la entrada x[n] pueden ser graficadas en Matlab utilizando:

n=[-3:10];
h=stepseq(0,-3,10)-stepseq(4,-3,10);
stem(n,h)
xlabel(‘n’); ylabel(‘h[n]’)

Figure 5. Impulse response h[n] for system in example 3.

n=[-3:10];
x=stepseq(-3,-3,10)-stepseq(1,-3,10);
stem(n,x)
xlabel(‘n’); ylabel(‘x[n]’)

Figure 6. Input signal x[n] for system in example 3.

Ahora, podemos graficar y[n] utilizando:

n=[-3:10];
h=stepseq(0,-3,10)-stepseq(4,-3,10);
x=stepseq(-3,-3,10)-stepseq(1,-3,10);
x1=stepseq(-2,-3,10)-stepseq(2,-3,10);
x2=stepseq(-1,-3,10)-stepseq(3,-3,10);
x3=stepseq(0,-3,10)-stepseq(4,-3,10);
y=x+x1+x2+x3;
stem(n,y)

Figure 7. Output sequence y[n] for example 3.

El mismo resultado lo hubiésemos obtenido utilizando:

La imagen tiene un atributo ALT vacío; su nombre de archivo es null-64.png

n=[-3:10];;
h=stepseq(0,-3,10)-stepseq(4,-3,10);
x=stepseq(-3,-3,10)-stepseq(1,-3,10);
y=conv(h,x);
n=[0:26];
stem(n,y)
xlabel(‘n’); ylabel(‘y[n]’)

Figure 8. Output sequence y[n]=x[n]*h[n] for example 3.

Fuente:

  • Digital Signal Processing Using Matlab, 3erd ed
  • Fundamentos_de_Señales_y_Sistemas_usando la Web y Matlab
  • Oppenheim – Señales y Sistemas
  • Análisis de Sistemas Lineales Asistido con Scilab – Un Enfoque desde la Ingeniería Eléctrica.

Relacionado:

Revisión literaria hecha por:

Prof. Larry Francis Obando – Technical Specialist – Educational Content Writer

Se hacen trabajos, se resuelven ejercicios!!

WhatsApp:  +34633129287  Atención Inmediata!!

Twitter: @dademuch

Copywriting, Content Marketing, Tesis, Monografías, Paper Académicos, White Papers (Español – Inglés)

Escuela de Ingeniería Electrónica de la Universidad Simón Bolívar, USB Valle de Sartenejas.

Escuela de Ingeniería Eléctrica de la Universidad Central de Venezuela, UCV CCs

Escuela de Turismo de la Universidad Simón Bolívar, Núcleo Litoral.

Contacto: España. +34633129287

Caracas, Quito, Guayaquil, Jaén. 

WhatsApp:  +34633129287     

Twitter: @dademuch

FACEBOOK: DademuchConnection

email: dademuchconnection@gmail.com

Digital Signal Processing

Convolution in Discrete-Time – Matlab

The output y[n] of a particular LTI-system can be obtained by:

The previous equation is called Convolution between discrete-time signals x[n] and h[n].

By convention, the convolution between x[n] and h[n] is expressed as follows:

Example 1. 

Let the following rectangular pulse x[n] be an input to an LTI system with impulse response h[n]:

Determine the output y[n] of the system.

Solution:

In Elementary sequences we have designed a function stepseq for plotting the unit step function in discrete time, or any combination as example 1. Next Script allows plotting x[n].

n=[0:40];
x=stepseq(0,0,40)-stepseq(10,0,40);
stem(n,x)
xlabel(‘n’); ylabel(‘x[n]’)

Figure 1. Input sequence x[n], example 1.

Next Script allows plotting h[n].

n=[0:40];
h=(0.9).^n;
stem(n,h)
xlabel(‘n’); ylabel(‘h[n]’)

Figure 2. Impulse response h[n] for system in example 1.

Now, we use conv Matlab function to determine y[n]:

y=conv(x,h);
n=[0:80];
stem(n,y);
xlabel(‘n’); ylabel(‘y[n]’)

Figure 3. Output sequence y[n]=x[n]*h[n] for example 1.

Another approach is by using the filter function (see Solving discrete-time differential equations):

n=[0:40];
x=stepseq(0,0,40)-stepseq(10,0,40);
h=(0.9).^n;
y=filter(h,1,x);
stem(n,y)
xlabel(‘n’); ylabel(‘y[n]’)
grid

What yields:

Figure 4. Output sequence y[n]=x[n]*h[n] for example 1.

There is a difference in the outputs of these two implementations that should be noted. As you can see in Figure 3, the output sequence from conv(x,h) function has a longer length than both x[n] and h[n] sequences. On the other hand, the output sequence from the filter(h,1,x) function in Figure 4 has exactly the same length as the input x[n] sequence. In practice, the use of the filter function is encouraged.

Watch out: The filter function can be used to compute the convolution indirectly. That was possible because of the impulse response in example 1 was a one-side exponential sequence for wich we could determine a difference equation representation. Not all infinite-lenght impulse responses can be converted into difference equations.

Analytical Convolution

We can do the convolution of x[n] and h[n] Analytically:

Applying the given equation for convolution:

We now use an expression for the sum of any finite number of terms of a geometric series (The Geometric Series in DSP), and that is given by:

So, we can express equation (1) as follows:

Equation (3) is almost a geometric series sum as equation (2) except that the terms u(n-k) takes different values depending on n and k. There are three possible conditions under u(n-k) which can be evaluated:

Case 1. n<0. Then u(n-k)=0 for 0 k 9. In consequence:

Case 2. In this case the nonzero values of and do not overlap. So, for 0n<9 then u(n-k)=1 for 0kn. In consequence:

Applying formula of equation (2):

Case 3. In this case the impulse response h[n] partially overlap the input x[n]. So, for 9 n. Then u(n-k)=1 for 0 k 9. In consequence:

In this last case h[n] completely overlaps the input x[n].

Graphical method

We can also use a graphical method as in the following example.

Example 2

The input signal x[n] to an LTI system with impulse response h[n]:

Determine graphically y[n] through:

La imagen tiene un atributo ALT vacío; su nombre de archivo es null-63.png

Solution:

Sequences x[k] and h[n-k], and the convolution of both signals can be seen as follows:

We can also use convolution properties as follows.

Example 3
Convolution Properties.

Other interesting properties are:

With an input x[n], the response of a LTI system y[n] is:

The impulse response h[n] of the system is:

Determine x[n]. Choose the right answer from:

Solution:

Considering:

We express the impulse response in terms of displaced Dirac deltas:

If we select:

Then:

So right answer is letter a). Demonstration: Using the previous equation, Let´s plot y[n] in Matlab.

The impulse response h[n] and option a) for input x[n] can be plotting in Matlab using:

n=[-3:10];
h=stepseq(0,-3,10)-stepseq(4,-3,10);
stem(n,h)
xlabel(‘n’); ylabel(‘h[n]’)

Figure 5. Impulse response h[n] for system in example 3.

n=[-3:10];
x=stepseq(-3,-3,10)-stepseq(1,-3,10);
stem(n,x)
xlabel(‘n’); ylabel(‘x[n]’)

Figure 6. Input signal x[n] for system in example 3.

Now, y[n] can be plotting by using:

n=[-3:10];
h=stepseq(0,-3,10)-stepseq(4,-3,10);
x=stepseq(-3,-3,10)-stepseq(1,-3,10);
x1=stepseq(-2,-3,10)-stepseq(2,-3,10);
x2=stepseq(-1,-3,10)-stepseq(3,-3,10);
x3=stepseq(0,-3,10)-stepseq(4,-3,10);
y=x+x1+x2+x3;
stem(n,y)

Figure 7. Output sequence y[n] for example 3.

Which we would also have been able to get by using:

La imagen tiene un atributo ALT vacío; su nombre de archivo es null-64.png

n=[-3:10];;
h=stepseq(0,-3,10)-stepseq(4,-3,10);
x=stepseq(-3,-3,10)-stepseq(1,-3,10);
y=conv(h,x);
n=[0:26];
stem(n,y)
xlabel(‘n’); ylabel(‘y[n]’)

Figure 8. Output sequence y[n]=x[n]*h[n] for example 3.

NEXT:

Source:

  • Digital Signal Processing Using Matlab, 3erd ed
  • Fundamentos_de_Señales_y_Sistemas_usando la Web y Matlab
  • Oppenheim – Señales y Sistemas
  • Análisis de Sistemas Lineales Asistido con Scilab – Un Enfoque desde la Ingeniería Eléctrica.

Literature review by:

Prof. Larry Francis Obando – Technical Specialist – Educational Content Writer

Exercises are solved!!

WhatsApp:  +34633129287  Inmediate Attention!!

Twitter: @dademuch

Copywriting, Content Marketing, Tesis, Monografías, Paper Académicos, White Papers (Español – Inglés)

Escuela de Ingeniería Electrónica de la Universidad Simón Bolívar, USB Valle de Sartenejas.

Escuela de Ingeniería Eléctrica de la Universidad Central de Venezuela, UCV Caracas.

Escuela de Turismo de la Universidad Simón Bolívar, Núcleo Litoral.

Contacto: España. +34633129287

Caracas, Quito, Guayaquil, Jaén. 

WhatsApp:  +34633129287   

Twitter: @dademuch

FACEBOOK: DademuchConnection

email: dademuchconnection@gmail.com

Sin categoría

La función coseno en tiempo discreto – Matlab

Las señales sinusoidales son muy importantes porque la Transformada de Fourier afirma que la mayoría de las señales de uso práctico se pueden descomponer en una suma infinita de señales sinusoidales. Una señal sinusoidal en el tiempo discreto se representa mediante:

Donde A es la amplitud y θo es la fase en radianes. Por su parte, ωo=2πf es la frecuencia angular y x[n] puede ser escrita como:

Es muy importante entender que la frecuencia de una sinusoide de tiempo discreto no está definida de forma única. Esta ambigüedad fundamental se debe a la siguiente propiedad trigonométrica:

En palabras, el valor de una sinusoide no cambia si un número entero múltiplo de se suma a su argumento. Sumando 2πkn al argumento de la ecuación (1) obtenemos:

Se distinguen dos casos. Si k≥-f, la ecuación (2) es equivalente a una sinusoide con frecuencia f+k sin cambio de fase:

Por otra parte, si k<-f, la ecuación (3) conduce a una frecuencia negativa. Para evita esto, definimos:

Además hacemos uso de la siguiente propiedad:

En consecuencia, volviendo a las ecuaciones (2) y (3), obtenemos una sinusoide de frecuencia l-f con una inversión de fase:

En conclusión: «a discrete-time sinusoid with frequency f is identical to a same-phase sinusoid of frequency f+k, where k is any integer greater than –f, or to a phase-reversed sinusoid of frequency l-f if l>f«.

La ecuación (3) se puede expresar de forma más concisa utilizando la notación exponencial compleja:

Because value of a complex exponential does not change if a multiple of is added to its argument, we get:

Equation (5) is equivalent to equation (4). Because of this fundamental frequency ambiguity, we will often implicitly assume that the angular frequency of a discrete-time sinusoid is restricted to the range –π≤ω≤π, or equivalent, that -1/2≤f≤1/2.

The Matlab function cos or sin generates the sinusoidal sequences. For example, for x[n]=3cos(0.1πn+π/3)+2sin(0.5πn), 0n10, we will use the following script:

n=[0:10]; x=3*cos(0.1*pi*n+pi/3)+2*sin(0.5*pi*n);
stem(n,x)

This script yields:

Source:

  • Digital Signal Processing Using Matlab, 3erd ed

PREVIOUS:

Literature review by:

Prof. Larry Francis Obando – Technical Specialist – Educational Content Writer

Exercises are solved!!

WhatsApp:  +34633129287  Inmediate Attention!!

Twitter: @dademuch

Copywriting, Content Marketing, Tesis, Monografías, Paper Académicos, White Papers (Español – Inglés)

Escuela de Ingeniería Electrónica de la Universidad Simón Bolívar, USB Valle de Sartenejas.

Escuela de Ingeniería Eléctrica de la Universidad Central de Venezuela, UCV CCs

Escuela de Turismo de la Universidad Simón Bolívar, Núcleo Litoral.

Contacto: España. +34633129287

Caracas, Quito, Guayaquil, Jaén. 

WhatsApp:  +34633129287     

Twitter: @dademuch

FACEBOOK: DademuchConnection

email: dademuchconnection@gmail.com

Sin categoría

The sinusoidal function in discrete time – Matlab

Sine waves are important because Fourier´s Theorem states that most signals of practical interest can be decomposed into an infinite sum of sine waves. Discrete-time signals (also called time series) are defined over the set of integers, that is, they are indexed sequences. A discrete-time sine wave is defined by:

Where A is an amplitude and  θo is the phase in radians. Meanwhile, ωo=2πf is the angular frequency and x[n] could be written as:

It is important to understand that the frequency of a discrete-time sinusoid is not uniquely defined. This fundamental ambiguity is a consequence of a basic trigonometric property:

In words, the value of a sinusoid does not change if an integer multiple of is added to its argument. Adding the 2πkn to the argument of equation (1) we get:

Two cases must be distinguished. If k≥-f, the equation (2) is equivalent to a sinusoid with frequency f+k with no change in phase:

On the other hand, if k<-f, equation (3) leads to a negative frequency. To avoid this, we introduce:

We also make use of the property:

In consequence, returning to equations (2) and (3), we obtain a sinusoid of frequency l-f with a reversal in phase:

In conclusion, a discrete-time sinusoid with frequency f is identical to a same-phase sinusoid of frequency f+k, where k is any integer greater than –f, or to a phase-reversed sinusoid of frequency l-f if l>f.

Equation (3) can be expressed more concisely using complex exponential notation:

Because value of a complex exponential does not change if a multiple of is added to its argument, we get:

Equation (5) is equivalent to equation (4). Because of this fundamental frequency ambiguity, we will often implicitly assume that the angular frequency of a discrete-time sinusoid is restricted to the range –π≤ω≤π, or equivalent, that -1/2≤f≤1/2.

The Matlab function cos or sin generates the sinusoidal sequences. For example, for x[n]=3cos(0.1πn+π/3)+2sin(0.5πn), 0n10, we will use the following script:

n=[0:10]; x=3*cos(0.1*pi*n+pi/3)+2*sin(0.5*pi*n);
stem(n,x)

This script yields:

Source:

  • Digital Signal Processing Using Matlab, 3erd ed

PREVIOUS:

Literature review by:

Prof. Larry Francis Obando – Technical Specialist – Educational Content Writer

Exercises are solved!!

WhatsApp:  +34633129287  Inmediate Attention!!

Twitter: @dademuch

Copywriting, Content Marketing, Tesis, Monografías, Paper Académicos, White Papers (Español – Inglés)

Escuela de Ingeniería Electrónica de la Universidad Simón Bolívar, USB Valle de Sartenejas.

Escuela de Ingeniería Eléctrica de la Universidad Central de Venezuela, UCV CCs

Escuela de Turismo de la Universidad Simón Bolívar, Núcleo Litoral.

Contacto: España. +34633129287

Caracas, Quito, Guayaquil, Jaén. 

WhatsApp:  +34633129287     

Twitter: @dademuch

FACEBOOK: DademuchConnection

email: dademuchconnection@gmail.com

Sin categoría

La Serie Geométrica – Procesamiento de Señales Digitales en Matlab

En Matlab es requerido el operador “” para implementar a real exponential sequence de la forma:

En el intervalo n1< no < n2. Por ejemplo, para implementar:

Usaremos la siguiente función de Matlab:

n=[0:10];;
x=(0.9).^n;
stem(n,x);
xlabel(‘n’); ylabel(‘x[n]’)

Este script genera:

Serie Geométrica

Una secuencia exponencial de un solo lado, de la forma:

Donde α es una constante arbitraria. Esta secuencia es llamada a geometric series.  En PDS, la convergencia y la expresión para la suma de los componentes de esta serie are es utilizado en muchas aplicaciones. La serie converge para:

Mientras se cumpla esta condición, la suma de los componentes de la serie geométrica converge a:

A partir de aquí, necesitamos además una expresión para la suma de cualquier número finito de términos de la serie, y está dado por:

Estos dos importantes resultados se utilizarán ampliamente en PDS.

Complex-valued exponential sequence

Where σ produces an attenuation (if<0) or amplification (if>0)  and ωo is the frequency in radians. The Matlab function exp generates the exponential sequences. For example, for x[n] =exp[(2+j3)n], 0n10, we will use the following script:

n=[0:10]; x=exp(3j*n);
stem(n,k)

This script yields:

Fuente:

  • Digital Signal Processing Using Matlab, 3erd ed

ANTERIOR:

También te puede interesar:

Revisión literaria hecha por:

Prof. Larry Francis Obando – Technical Specialist – Educational Content Writer

Se hacen trabajos, se resuelven ejercicios!!

WhatsApp:  +34633129287  Atención Inmediata!!

Twitter: @dademuch

Copywriting, Content Marketing, Tesis, Monografías, Paper Académicos, White Papers (Español – Inglés)

Escuela de Ingeniería Electrónica de la Universidad Simón Bolívar, USB Valle de Sartenejas.

Escuela de Ingeniería Eléctrica de la Universidad Central de Venezuela, UCV CCs

Escuela de Turismo de la Universidad Simón Bolívar, Núcleo Litoral.

Contacto: España. +34633129287

Caracas, Quito, Guayaquil, Jaén. 

WhatsApp:  +34633129287     

Twitter: @dademuch

FACEBOOK: DademuchConnection

email: dademuchconnection@gmail.com

Procesamiento de señales digitales

The Geometric Series in Digital Signal Processing

In Matlab an array operator “” is required to implement a real exponential sequence of the form:

Over the n1< no < n2 interval. For example, to implement:

We will use the following Matlab function:

n=[0:10];;
x=(0.9).^n;
stem(n,x);
xlabel(‘n’); ylabel(‘x[n]’)

This script yields:

Geometric series

A one-side exponential sequence of the form:

Where α is an arbitrary constant. This sequences is called a geometric series.  In DSP, the convergence and expression for the sum of this series are used in many applications. The series converges for:

While this condition is true, the sum of the geometric series components converges to:

From here, we also need an expression for the sum of any finite number of terms of the series, and that is given by:

These two important results will be used deeply throughout DSP.

Complex-valued exponential sequence

Where σ produces an attenuation (if<0) or amplification (if>0)  and ωo is the frequency in radians. The Matlab function exp generates the exponential sequences. For example, for x[n] =exp[(2+j3)n], 0n10, we will use the following script:

n=[0:10]; x=exp(3j*n);
stem(n,k)

This script yields:

Source:

  • Digital Signal Processing Using Matlab, 3erd ed

PREVIOUS:

Literature review by:

Prof. Larry Francis Obando – Technical Specialist – Educational Content Writer

Exercises are solved!!

WhatsApp:  +34633129287  Inmediate Attention!!

Twitter: @dademuch

Copywriting, Content Marketing, Tesis, Monografías, Paper Académicos, White Papers (Español – Inglés)

Escuela de Ingeniería Electrónica de la Universidad Simón Bolívar, USB Valle de Sartenejas.

Escuela de Ingeniería Eléctrica de la Universidad Central de Venezuela, UCV CCs

Escuela de Turismo de la Universidad Simón Bolívar, Núcleo Litoral.

Contacto: España. +34633129287

Caracas, Quito, Guayaquil, Jaén. 

WhatsApp:  +34633129287     

Twitter: @dademuch

FACEBOOK: DademuchConnection

email: dademuchconnection@gmail.com