-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathchannel.m
More file actions
23 lines (18 loc) · 799 Bytes
/
channel.m
File metadata and controls
23 lines (18 loc) · 799 Bytes
1
%----------------------------------------------------%----------------- Parameters -----------------------%----------------------------------------------------SNR = 20;%----------------------------------------------------%----------------- Calculation ----------------------%----------------------------------------------------Tx_Power = (1/length(Tx)) * sum((real(Tx).^2 + imag(Tx).^2));SNRlin = power(10, SNR/10);%%noise = sqrt(Tx_Power/(2*SNRlin)) * [randn(1, length(Tx)) + j*randn(1, length(Tx))];noise = sqrt(Tx_Power/(2*SNRlin)) * randn(1, length(Tx));Rx = Tx + noise;%----------------------------------------------------%----------------- Clear ----------------------------%----------------------------------------------------clear SNR SNRlinclear noiseclear Tx_Power Tx