[249cf9]: comp / comp_transferfunction.m  Maximize  Restore  History

Download this file

29 lines (20 with data), 562 Bytes

 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
26
27
28
function H=comp_transferfunction(g,L)
%COMP_TRANSFERFUNCTION Compute the transfer function
l=(0:L-1).'/L;
if isfield(g,'h')
g_time=circshift(postpad(g.h,L),g.offset).*...
exp(2*pi*1i*round(g.fc*L/2)*l);
if g.realonly
g_time=real(g_time);
end;
H=fft(g_time);
else
if ~isnumeric(g.H)
g.H=g.H(L);
g.foff=g.foff(L);
end;
H=circshift(postpad(g.H,L),g.foff).*exp(-2*pi*1i*round(g.delay)*l);
if g.realonly
H=(H+involute(H))/2;
end;
end;

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks