IFFT function length question
Mostrar comentarios más antiguos
I made a piecewise function that I want to take the inverse fourier transform of,both vector sizes are 1,4096 but for some reason there is an error stating the left and right side of the equation have mismatching sizes.
%Charles Moody %DSP Homework 11 - Custom FIR Problem 2 fs = 10000; n = 1024; f = 0:fs/n:(n-1)*fs/n; %The desired frequency response can be spelled out in a for loop L10W = zeros(1,4*n); for m = 1:4096 if m < 948 L10W(m) = 0; elseif m >= 948 && m<1048 L10W(m) = (-40/100)*(m-948); elseif m >= 1048 && m<1948 L10W(m) = -40; elseif m >= 1948 && m < 2048 L10W(m) = (20/100)*(m-1948)-40; elseif m >= 2048 && m <2948 L10W(m) = -20; elseif m >= 2948 && m<3048 L10W(m) = (-40/100)*(m-2948)-20; elseif m >= 3048 && m<4092 L10W(m) = -60; else L10W(m) = (-25/5)*(m-4092)-60;
end
end
%plot(L10W) %axis([200 4500 -80 10])
%now we have to get itout od decibels into base 1 unitslike volts
W = zeros(1,length(L10W)); for m = 1:(4*n) W(m) = 10^(L10W(m)/20); end
%plot(W)
h = zeros(1,length(W)); for m = 1:(4*n) h(m) = ifft(W); end
plot(h)
1 comentario
Charles Moody
el 26 de Abr. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Transforms en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
