

The last line of the Matlab script converts the decimal numbers to character symbols forming the message received in rcv.

These numeric photon counts (corresponding to the act values are co verted to string format and then from string to decimal numbers.
#WHAT IS MATLAB P FILE CODE#
The following Matlab script could be used for that purpose: idnumber = '88888888' mode = '0' nbits = 50 number_of_photons optical_fiber_detector (idnumber, mode nbits) To convert eight-bits long sequences of zeros and ones from binary format to printable character symbols, you can use the following Matlab script: ascii_len = 8 % we are using ASII code with 8 bits rcv = num2str(rcv) rcv = bin2dec (reshape (rcv, ascii_len, length (rcv)/ascii_len)') ascii_message = char (rcv) In this Matlab script, rcv represents a column vector containing the numeric values of the l received bits). As an example, a user with an ID number 88888888 could use optical_fiber_detector.p to generate 50 photon counts for a message corresponding to 50 bits, all equal to 0. The definition of these variables is as follows: idnumber input string is the user's UTEP ID number mode input string: equal to '0', the function returns the photon counts for a message with all bits equal to zero '1', t returns the counts for all bits equal to one and 'EE3384', it returns the counts for your specific message (the message that you will need to decode) nbits input variable is the corresponding number of bits received in modes '0' or '1' (if mode is equal to 'EE3384', the input variable nbits is not required your message has a fixed number of bits) number_of_photons output vector is a column vector with the photon counts for the bits received (note that the photon counts are random variables). This function has up to three input variables, idnumber, mode and nbits, and it returns one output vector, number-of-photons. The Matlab function optical_fiber_detector.p generates the photon counts for bits transmitted through an optical communication system and counted in the photodetector side. p simulates an optical communication system. The p-code Matlab function optical_fiber_detector. You will write a Matlab script to decode the message detected by the Matlab function optical_fiber_detector. Transcribed image text: In this homework you will use the Matlab function optical_fiber_detector.p to simulate an optical communication system and gencrate the number of photons of a binary message being received.
