1.0

1.0 | 1 rating Rate this file 3 Downloads (last 30 days) File Size: 495 Bytes File ID: #23501
image thumbnail

Group delay

by Marcos López

 

31 Mar 2009

Calculates and plots the group delay for an s domain system.

| Watch this File

File Information
Description

Calculates and plots the group delay in a semilogx scale for a system created using tf. This includes to continuous time systems and s domain transfer functions.

For example
H = tf(1,[1 1]); %// 1st order low pass with cut off at 1 rad/sec
 groupDelaytf(H)
This will plot the group delay of the filter specified in H.

Required Products Control System Toolbox
MATLAB release MATLAB 7.3 (R2006b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
01 Apr 2009 Duane Hanselman

Here is what is in this submission:
function groupDelay = groupDelaytf(SYS,varargin)
freqScale = 'rad/s';
if nargin > 2
    disp('Too many input arguments!');
    groupDelay = [];
    return
elseif nargin > 1
    freqScale = varargin{1};
end
sk = 2*pi;
if strcmp(freqScale,'Hz') || strcmp(freqScale,'hz')
    sk = 1;
end
[M,P,w] = bode(SYS);
w = linspace(w(1),w(end),length(w)*1000)/(sk);
[M,P] = bode(SYS,w*2*pi);
P = P(:)';
groupDelay = -gradient(P,w)/360;
grid on
semilogx(w*sk,groupDelay)
return

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
bode Marcos López 01 Apr 2009 10:09:39
group delay Marcos López 01 Apr 2009 10:09:39
simulation Marcos López 01 Apr 2009 10:09:39
group delay Ismail Delice 03 Apr 2009 10:28:35

Contact us at files@mathworks.com