Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Looking for Matlab code for groupdelay

Status
Not open for further replies.

Manikanta

Newbie level 1
Joined
Oct 20, 2004
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
5
Need urgent help

Can any one send me matlab code for groupdelay
 

Re: Need urgent help

Hi Manikanta

some explanation about Group delay

%Group delay:
%
% Imagine an AM signal with a sinusoidal modulation. The carrier is high-frequency and the modulation is low-frequency. Compare the AM signal with the unmodulated carrier: they are in phase (the zero-crossings are coincident).
% Now, let pass the AM signal by a linear network (e.g. a filter). We will see an AM signal at the ouput.
% * Look at the carrier (the high-frequency sinusoid whose amplitude varies) at the output and compare it with the carrier at the input. They are not in phase: the output carrier is delayed with respect to the input carrier. This delay in the carrier, measured in phase units, is the phase delay.
% * Look at the envelope at the output and compare it with the envelope at the input. They are not in phase: the output envelope is delayed with respect to the input envelope. This delay in the envelope, measured in time units, is the envelope delay, called also group delay.
%
% The same effect arises considering an DSB-SC signal (AM with suppressed carrier or Double Side Band with no carrier). It is easier to explain with AM bacause there are no phase inversions, but it is easier to calculate the effect with DSB-SC bacause it has only 2 components (the two sidebands) instead of 3 as AM has (the two sidebands and the carrier).
%
% The DSB-SC signal contains 2 spectral lines (the 2 sidebands). You can calculate the phase delay: it is the phase of the transfer function of the network at the central frequency (i.e. the suppressed carrier).
% You can calculate the group delay: it is the difference in phase at the two sidebands divided by the difference in frequency, or approximately, the derivative of the phase with respect to the frequency at the central frequency.
%
% The delay in the envelope arises because the two components are subject to different phase rotation.
%
% Now consider a carrier modulated in amplitude with a complex waveform (e.g. a pulse) and suppose we pass this signal by a filter. Suppose that in the bandwidth accuped by that signal the filter has a characteristic that is flat in amplitude and linear in phase. We will see at the output a signal that is similar to the input but:
% * The phase (you can think at the zero-crossings) is delayed by the phase delay
% * The envelope is delayed by the group delay
%
% A flat group delay characteristic is important to assure that the shape of signals (that is contained in amplitude) is not severely distorted when they pass by a filter, a channel, etc.


the simples group delay calculation in matlab can be done like this

voltage_gain; %complex vector in function of freq
freq; %frequency grid (rad/s); uniform sampling prefered

p=unwrap(angle(voltage_gain));

group_dalay=-diff(p)/diff(frq); %simple aproximation of the derivative -d_phase/d_freq


note that I've just sketch the idea by the lines above.

Best Regards
dora
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top