qutab
qutab

Reputation: 307

How to choose the amplification factor for the required SNR in MatLab

I have a given noise vector with certain variance. That cannot be changed. I have an IQ-modulated signal and it needs to be amplified to get an SNR of 20dBs. How do I go about that?

k = 3/2;                    %certain variance
n = sqrt(k).*randn(1, N);   %noise vector
noise_power = var(n);

SNR = 10*log10(var(Xiq)/noise_power)   %current SNR in dB of the IQ modulated signal

%% Part 4
amp = 13.5;                 %some amplification, I can't figure out what it should be
Xamp = amp.* Xiq;
SNR = 10*log10(var(Xamp)/noise_power)   %SNR in dB should be 20 dBs

currently I am using a fixed scaling factor but I know this isn't the correct way to do it. Can someone help me please?

Upvotes: 1

Views: 1283

Answers (1)

Rasman
Rasman

Reputation: 5359

As a general rule for variance:

Var (A*X) = A^2*Var(X) (if A is a constant).

so

SNR =  10*log10(var( amp* Xiq)/noise_power)
    =  10*log10(amp^2*var(Xiq)/noise_power)
    =  10*log10(amp^2) + 10*log10(var(Xiq)/noise_power)
    =  20*log10(amp) + SNR_original
    =  20

ergo

20*log10(amp) = 20 - SNR_original
log10(amp) = (20 - SNR_original)/20
amp = 10^((20 - SNR_original)/20)

Upvotes: 4

Related Questions