how can i integrate an array with respect to frequency w (omega)? the command "integral" requires function 'fun' to be declared as function of omega. how can i do this?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Saiankita Anand
am 26 Jun. 2016
Kommentiert: Star Strider
am 30 Jun. 2016
FB and W are frequency responses of two FIR filters fb and w. This is essentially what I am doing:
numer1=(abs(FBW-W)).^2; fun=@(omega) numer1; numer=integral(fun,0,pi,'ArrayValued',true);
0 Kommentare
Akzeptierte Antwort
Star Strider
am 26 Jun. 2016
What you believe you’re doing is not what you’re actually doing.
I’m just guessing here because I don’t have either ‘FB’ or ‘W’:
FBW = @(omega) ... SOMETHING ...;
W = @(omega) ... SOMETHING ELSE ...;
numer1 = @(omega) (abs(FBW(omega)-W(omega))).^2;
fun=@(omega) numer1(omega);
numer=integral(fun,0,pi,'ArrayValued',true);
Also, squaring abs is redundant (unless the argument is complex), because the square will be positive.
NOTE — This is obviously UNTESTED CODE. You may have to experiment with it to get it to work in your application.
6 Kommentare
Star Strider
am 30 Jun. 2016
My pleasure.
The equation you posted specifically states integrating on the interval [0,pi], so your code is correct.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Digital Filter Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!