Borrar filtros
Borrar filtros

What the calc is this?

2 visualizaciones (últimos 30 días)
Matheus Tirado
Matheus Tirado el 28 de Jun. de 2023
Comentada: Rena Berman el 5 de Dic. de 2023
p=[1 -1 -2];
Roots(p)
i=0:20
yi=A1*z^i+A2*z^i;
stem(yi)
B=[1 1],
A=[1];
N=1:50;
Xn=cos(pi*n)
Yn=filter(b,a,xn);
Stem(n,yn)
  4 comentarios
DGM
DGM el 29 de Nov. de 2023
Google doesn't have this cached (maybe it got purged). Is there a way these things can be reverted from the database?
Rena Berman
Rena Berman el 5 de Dic. de 2023
undefined

Iniciar sesión para comentar.

Respuestas (1)

Keerthi Reddy
Keerthi Reddy el 30 de Jun. de 2023
Hi Matheus, It is my understanding that you want to know what the above-mentioned calculation represents.
Here is the answer:
p = [1 -1 -2];
r = roots(p);
disp(r);
To calculate the roots of a polynomial 'p', you can use the “roots” function in MATLAB. The output will be the roots of the polynomial 'p'. You can go through this documentation to know more: Polynomial roots - MATLAB roots - MathWorks India
z = 0.9; % Choose a value for z
A1 = 1; % Choose a value for A1
A2 = 2; % Choose a value for A2
i = 0:20;
yi = A1*z.^i + A2*z.^i;
stem(i, yi);
The above code generates a sequence yi = A1*z^i + A2*z^i for i ranging from 0 to 20 and plots it using a stem plot. You can go through the documentation to know more: Plot discrete sequence data - MATLAB stem - MathWorks India
If you have a transfer function defined by numerator B and denominator A, and you want to filter a sequence xn using this transfer function, you can use the filter function. The following code does the same. B = [1 1];
A = [1];
n = 1:50;
xn = cos(pi*n);
yn = filter(B, A, xn);
stem(n, yn);
You can go through this documentation to know more: 1-D digital filter - MATLAB filter - MathWorks India.
Hope this helps .

Etiquetas

Productos


Versión

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by