# How can I add complex WGN to a complex damped signal for a specified SNR?

I want to add complex wgn to a signal for a specified SNR. I have been using the following lines:

SNR = -10:5:50;
for l = 1:length(SNR)
SignalN = awgn(Signal, SNR(l),'measured','dB');
end


where $$Signal$$ is the actual complex damped signal and the $$SNR$$ is in dB. I want to replace the above line with $$randn$$ function in MATLAB that considers the definition of WGN and SNR in dB. can someone help me with this?

• just type edit awgn.m and you access to the source code of the awgn() function. Jun 14 '21 at 10:50
• Do you want to noise to be complex as well ? Jun 14 '21 at 11:09
• Thank you AlexTP. I do not want to continue using awgn, instead I want to use randn function that fulfils the same requirement as awgn. Jun 14 '21 at 11:10
• Hi Hilmar. Yes I want it to be complex WGN, but without using the awgn or wgn functions from MATLAB. I want it to be with randn function in MATLAB Jun 14 '21 at 11:11
• @Neuling well, if you ever look at the implementation of awgn(), it does use randn(). Jun 14 '21 at 12:35

%  create complex white normal noise

• Done. Should have been $log(10)$. It's just turning dB into a linear gain Jun 15 '21 at 13:14