⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ssbamft.m

📁 数字通信第四版原书的例程
💻 M
字号:
function [num,den,nl,dl]=ssbamft(Fc,order,part)
%SSBAMFT   is a function designing filters for SSB SC AM.
%   [NUM,DEN]=DSBAMFT(Fc)
%   generate a 6th order lowpass filter with the cutoff
%   frequency at Fc*2*pi.
%   [NUM,DEN]=DSBAMFT(Fc,ORDER,PART) 
%   outputs the filter with cut-off frequency at Fc,
%   with ORDER. When PART is 'upper', the filter is 
%   a highpass filter. When PART is 'lower', the filter
%   is a lowpass filter.

%   Copyright (c) 1996 by The MathWorks, Inc.
%   $Revision: 1.1 $  $Date: 1996/04/01 19:40:50 $


if nargin < 1
    error('There is no specified parameters')
end;

if nargin < 2
    order = 6;
end;

if nargin < 3
    part='hig';
end;

if length(part)<3
    part='hig';
end;

Fc=Fc*2*pi;
if (lower(part(1:3))=='upp') | (lower(part(1:3)=='low'))
  if lower(part(1:3))=='upp'
    [a,b,c,d]=cheby1(order,2,Fc,'high','s');
  else
    [a,b,c,d]=cheby1(order,2,Fc,'s');
  end;
  %compensate the gain lost
%  gain=bode(a,b,c,d,1,Fc);
  [t, a] = balance(a);
  b = t \ b;
  c = c * t;
  [p, a] = hess(a);
  b = p' * b(:,1);
  c = c * p;
  d = d(:, 1);
  gain = ltifr(a, b, Fc);
  gain = (c * g + diag(d) * ones(size(a,1), 1)).';

  gain=1/gain;
  c=gain*c;
  d=gain*d;
  [num,den]=ss2tf(a,b,c,d);
else
  num=[]; den=[];
end;

%the following is for the lower pass filter.
if nargout>2
    [a,b,c,d]=cheby1(order,2,Fc/10,'s');
%    gain=bode(a,b,c,d,1,Fc/10);
    [t, a] = balance(a);
    b = t \ b;
    c = c * t;
    [p, a] = hess(a);
    b = p' * b(:,1);
    c = c * p;
    d = d(:, 1);
    gain = ltifr(a, b, Fc/10);
    gain = (c * g + diag(d) * ones(size(a,1), 1)).';
    gain=1/gain;
    c=gain*c;
    d=gain*d;
    [nl,dl]=ss2tf(a,b,c,d);
end;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -