Expressing changing array.
Mostrar comentarios más antiguos

I am trying to solve this system in order to optimize a remez algorithm I am working on.The problem is I can not figure out how to calculate the summations with the changing 'cos' because of the n factor. I tried to write a for loop but it creates a matrix which I do not need.
L = 51; %filter length
ws1 = 0.4*pi; % the start of the transition zone
wp1 = 0.5*pi; % the end of the transition zone
Ks1 = 1;
Kp = 2;
wo = (ws1+wp1)/2;
G = 5000; %the grid size
w = [0:(G-1)]*pi/L;
W = Ks1*(w<=ws1) + Kp*(w>=wp1) %the weight function
D = (wp1>=w); %the ideal function
N=(L-1)/2
m=0:N
k=1:4999
F(k)=(W(k).^2).*D(k))*cos(w(k).*m')
I tried to leave the summations out of it and I think this was the closest I got to creating the correct array but it does not work either.I know there is probably something I miss but I only use matlab for couple of days and it really troubles me.
1 comentario
Jason Psimopoulos
el 7 de Dic. de 2020
Respuestas (0)
Categorías
Más información sobre Entering Commands en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!