Untitled

                Never    
for i=1:1:length(SNR)
    
    % Noise Addition
    Rx_Sequence = awgn(result_wave, SNR(i), 'measured');
    
    % Matched Filter 
    
    g = s1 - s2;
    
    % Shift and Reverse of g(t)
    hMF = fliplr(g);
    
    Rx = zeros(1, length(bits));
    
    low = 1;
    high = m;
    s = zeros(1, m);
    % Applying convolution process in the receiver
    for j=1:1:length(bits) 
     
        s = Rx_Sequence(low : high);
        res = conv(s, hMF);
        Rx(j) = res(10);
        low = low + 10;
        high = high + 10;
    end
    
    % Comparing with threshold 
    rec = Rx >= 0.5;
    
    % Counting errors
    BER(i) = size(find(rec - bits), 2); 
        
end

Raw Text