How to find 3db lower and upper frequency bound for frequency response of this problem?
57 views (last 30 days)
Show older comments
Hitesh Suthar
on 11 Oct 2016
Commented: Star Strider
on 11 Oct 2016
Hello guys, I want to find the 3db upper and lower frequency(Hz) bound for the frequency response of below described code. I have plotted the frequency response(Bandwidth) but how to get the 3db point change. Following is the code of the problem:
clear all
clc
frequency=[10 50 100 200 500 1*10^3 2*10^3 5*10^3 10*10^3 20*10^3 50*10^3 100*10^3 200*10^3 500*10^3 1*10^6 2*10^6 7*10^6 8*10^6 9*10^6 11*10^6 12*10^6 15*10^6 17*10^6 18*10^6 20*10^6 22*10^6 25*10^6 27*10^6 30*10^6]; %Frequency in Hz
vi=[84 88 92 88 88 88 88 88 88 88 88 88 88 88 88 88 43 43 47 43 43 46 47 47 48 48 43 43 45]; %Input voltage
vo=[109 390 600 770 880 940 960 980 980 960 1010 1010 1010 1010 980 940 370 350 320 290 270 230 210 190 180 170 130 120 110]; %Output voltage
gain=( vo./vi) %Finds the gain for respective voltage values
figure(1)
semilogx(frequency,gain) % Plots the frequency response of the system
0 Comments
Accepted Answer
Star Strider
on 11 Oct 2016
The -3 dB points are by definition the half-power points (that’s my understanding), so the easiest way is to calculate the power, find their approximate location and then let interp1 calculate them exactly. If your definition of the -3 dB points is different, you can easily adapt my code.
The Code:
pwr = gain.^2; % Power
hpp = max(pwr/2); % Half-Power Points
zci = @(v) find(v(:).*circshift(v(:), [-1 0]) <= 0); % Returns Approximate Zero-Crossing Indices Of Argument Vector
db3idx = zci(pwr-hpp);
for k1 = 1:size(db3idx,1)
idxrng = db3idx(k1):db3idx(k1)+1;
db3(k1) = interp1(pwr(idxrng), frequency(idxrng), hpp, 'spline','extrap');
end
figure(1)
semilogx(frequency,gain) % Plots the frequency response of the system
hold on
plot(db3, [1 1]*sqrt(hpp), '+r', 'MarkerSize',10)
hold off
grid
legend('Gain', 'Half-Power Points', 'Location','S')
The Plot"
2 Comments
More Answers (0)
See Also
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!