MATLAB Answers

About Implementing a AGC

9 views (last 30 days)
I am trying to Implement AGC,After demodulator block i am using AGC Block.When i have given input to my AGC it is multiplying every sample with the same gain but agc should be choose the which sample has to be multiplied with what amount of what logic is usefull for me to wirte so that my AGC can choose the gain according to the sample...


Dimitris Kalogiros
Dimitris Kalogiros on 6 Sep 2019
1) Are you working with matlb or simulink ?
2) do you prefer a feedback or a feedforward structure?
Keep in mind that AGCs aims to keep the average power of the incoming signal almost constant
Hari Ijjada
Hari Ijjada on 6 Sep 2019
i am working with matlab..i prefer a feedback structure..if you want to decrease the noise level of AGC how can i decrease the level ?

Sign in to comment.

Accepted Answer

Dimitris Kalogiros
Dimitris Kalogiros on 6 Sep 2019
Dear Hari
Here you are a simple version of a "feedback" structured AGC
clearvars; clc;
%% time instances
%% input signal
A=10; f=0.25;
%% AGC parameters
% loop filter gain
% Target power
%% AGC process
for n=1:length(t)
% amplify current input sample
% adjust agc gain, with feedback branch
gainAGC(n+1)=gainAGC(n)*(1 - (1/L)*(yout(n)^2-powerTarget) );
%% Plot input and output
plot(t, xin, '-b'); hold on;
plot(t, yout, '-r'); zoom on; grid on;
xlabel('t in sec'); ylabel('amplitude');
legend('xin', 'yout'); title('AGC input and output');
plot(t, gainAGC(1:end-1)); zoom on; grid on;
title('gain of AGC');
I have choosen a very simple version of gain adaptation.
Keep in mind that parameter L controls the speed of AGC lock. Large values of L leads to a fast but noisy convergence.
If you run this code, with the parameters I've choosen, you will get the following results:


Hari Ijjada
Hari Ijjada on 7 Sep 2019
But i want to give voice signal as input....whem i am giving voice sigal how to calculate the value of L ?..
if possible can you tell me how to apply AGC to voice input..
Dimitris Kalogiros
Dimitris Kalogiros on 7 Sep 2019
It depents on your sampling rate. For example, suppose you have voice signal , sampled at Fs. You can set L=100*Fs or L=1000*Fs (Fs is expressed in Hz)
By the way, you can experiment on the value of L.

Sign in to comment.

More Answers (0)

Sign in to answer this question.