微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 天线设计和射频技术 > Bandwidth function in MATLAB

Bandwidth function in MATLAB

时间:04-06 整理:3721RD 点击:
I'm pretty sure I'm screwing this up pretty badly due to my limited understanding of MATLAB but I am trying my best. A passive low pass filter was assembled and measured the output via an o-scope. At each frequency from the signal generator we wrote down the input/ouput Vpp. Using that data I am trying to determine an ideal bandwidth however I am getting an error I simply cannot identify, "Undefined function 'bandwidth' for input arguments of type 'double'." Here is the m-file code. If I am simply going about this all wrong can someone identify the correct method? Thank you.

clear all
clc
close all

f = [1e3 5e3 10e3 13.2e3 15e3 20e3 25e3 30e3 35e3 40e3 45e3 50e3 55e3 ...
60e3 65e3 70e3]; % Frequency, Hz
fc = 13.2e3; % Cutoff Frequency

Vin = [200e-3 200e-3 200e-3 200e-3 200e-3 200e-3 200e-3 200e-3 200e-3 ...
200e-3 200e-3 200e-3 200e-3 200e-3 200e-3 200e-3]; % Input, mVpp

Vout = [0.168e-1 0.656e-1 1.12e-1 1.32e-1 1.44e-1 1.60e-1 1.68e-1 ...
1.76e-1 1.76e-1 1.80e-1 1.84e-1 1.84e-1 1.88e-1 1.91e-1 1.92e-1 ...
1.92e-1]; % Output, mVpp

DC_gain = Vout./Vin; % DC gain.
dB_gain = 20*log10(Vout./Vin) % Gain.
dB_drop = max(dB_gain-3) % Critical gain drop(Cutoff point for the -3 dB bandwidth/(range of
% frequencies where the amplitude gain is above 70.7% of the maximum
% amplitude gain, and above half the maximum power gain)).

semilogx(f, dB_gain, 'sk-')
grid;
xlabel('Frequency, Hz');
ylabel('Gain, dB')
title('Gain vs. Frequency');

fb = bandwidth(f, dB_drop) % Calculates the bandwidth.
bw = 100*(fb/fc) % Bandwidth percentage.

fb = bandwidth(f, dB_drop) <---------- What is it?


this is how it looks with me

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top