0% found this document useful (0 votes)
13 views1 page

NRZ Inipol

The document describes a function that implements basic Unipolar Non-Return-to-Zero (NRZ) line coding to encode a binary data stream. In this scheme, a binary '1' is represented by a constant positive voltage level, while a binary '0' corresponds to zero voltage. The function checks for valid binary input and generates a signal based on the specified bit rate and amplitude.

Uploaded by

copeyic220
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

NRZ Inipol

The document describes a function that implements basic Unipolar Non-Return-to-Zero (NRZ) line coding to encode a binary data stream. In this scheme, a binary '1' is represented by a constant positive voltage level, while a binary '0' corresponds to zero voltage. The function checks for valid binary input and generates a signal based on the specified bit rate and amplitude.

Uploaded by

copeyic220
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

function nrz_signal = basic_unipolar_nrz_encoder(binary_data, bit_rate, amplitude, time_vector) %

basic_unipolar_nrz_encoder(binary_data, bit_rate, amplitude, time_vector) % implements basic Unipolar Non-Return-to-


Zero (NRZ) line coding. % % What it does: This function encodes a binary data stream using the Unipolar % Non-
Return-to-Zero (NRZ) line coding scheme. In Unipolar NRZ, a binary '1' % is represented by a constant positive voltage
level (amplitude) for the % entire bit duration, and a binary '0' is represented by a zero voltage level % for the entire bit
duration. % % Theory: Line coding is the process of converting digital data into a % format suitable for transmission
over a physical medium. Unipolar NRZ is a % simple line coding scheme where the signal level remains constant during
% each bit interval. It's called 'unipolar' because only one polarity (positive % or zero) is used to represent the binary
states. 'Non-Return-to-Zero' means % that the signal does not return to a zero voltage level between consecutive % bits.
The duration of each voltage level corresponds to the bit duration, % which is the inverse of the bit rate.

if ~isvector(binary_data) || ~all(ismember(binary_data, [0, 1]))


error('Binary data must be a vector of 0s and 1s.');
end

bit_duration = 1 / bit_rate;
nrz_signal = zeros(size(time_vector));

for i = 1:length(binary_data)
start_time = (i - 1) * bit_duration;
end_time = i * bit_duration;

if binary_data(i) == 1
nrz_signal = nrz_signal + (time_vector >= start_time & time_vector < end_time) * amplitude;
end
% For binary 0, the signal remains at 0 (initialized)
end

end

% Example usage: data = [1 0 1 1 0]; rate = 2; % 2 bits per second amp = 5; t = 0:0.01:3;

nrz_encoded = basic_unipolar_nrz_encoder(data, rate,

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy