I tried to calculate the Power of a the spectrum of a Continuous Wave (Pin=-10dB)
via Pf=10*log10(trapz((((Ufrequ/sqrt(2)).^2)./R)*10^3)) in Matlab and the result is -9.9476dB
but when I try to solve the integral via Pf=10*log10(trapz(f,(((Ufrequ/sqrt(2)).^2)./R)*10^3))
I get Pf = 3.0686e+000.
What is wrong with the second way resp. what wrong with way1?thanks
In the first one you are not giving a first argument (in the second you give "f"), and tghe function trapz assumes by default that the space is 1.
Surely the space between values in your "f" vector is 20. Right?
Regards