About Implementing a AGC
조회 수: 17 (최근 30일)
이전 댓글 표시
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 gain.so what logic is usefull for me to wirte so that my AGC can choose the gain according to the sample...
댓글 수: 5
Dimitris Kalogiros
2020년 3월 26일
Dear Shilpa
Allow me to ask: Your problem is with simulink implementation or you feel that you don't have understood the functionality of an agc loop ?
shilpa kamble
2020년 3월 26일
sir, I have problem with simulink implementation.Atcually I m tring to do implement the AGC to adjust gain of AGC to have an constant signal level output.
채택된 답변
Dimitris Kalogiros
2019년 9월 6일
Dear Hari
Here you are a simple version of a "feedback" structured AGC
clearvars; clc;
%% time instances
dt=0.001
t=0:dt:20;
%% input signal
A=10; f=0.25;
xin=A*sin(2*pi*f.*t);
%% AGC parameters
% loop filter gain
L=round(10*f*(1/dt));
% Target power
powerTarget=0.2;
%% AGC process
yout=zeros(1,length(xin));
gainAGC=ones(1,length(xin));
for n=1:length(t)
% amplify current input sample
yout(n)=gainAGC(n)*xin(n);
% adjust agc gain, with feedback branch
gainAGC(n+1)=gainAGC(n)*(1 - (1/L)*(yout(n)^2-powerTarget) );
end
%% Plot input and output
figure;
subplot(2,1,1);
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');
subplot(2,1,2);
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:
댓글 수: 2
Dimitris Kalogiros
2019년 9월 7일
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.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!