Here, A basic simulink model for Rayleigh BER performance is attached. Model consists of simplest design of transmitter, Rayleigh + AWGN channel, Threshold detector using matlab function as well as C programming based S-function. Mex command is used for C program compilation. Run "wireless_ber_test.m" file and verify that both the detector output matches.Â