-
Notifications
You must be signed in to change notification settings - Fork 0
/
tfdomain.m
26 lines (22 loc) · 835 Bytes
/
tfdomain.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function [s frq] = tfdomain(npts,freq_interval,opt)
% [s frq] = domain_tfunc(npts,freq_interval)
%
% frq and s are using in so many routines and they never change, so
% I wrote a function to load them in memory. If we ever change the
% desired frequency range, we can then do it globally via modifying this
% function.
%
% Default is 3200 points from 10^9 to 10^10, distributed logly
if ~exist('npts','var') || isempty(npts)
npts = 3200; % default number of sample points
end
if ~exist('freq_interval','var') || isempty(freq_interval)
freq_interval = [9 10]; % default frequency range
end
if exist('opt','var') && strcmp(opt,'linear')
frq = linspace(10^freq_interval(1),10^freq_interval(2),npts);
else
frq = logspace(freq_interval(1),freq_interval(2),npts);
end
omega = 2*pi*frq;
s = 1i * omega;