the purpose of this code segment

1 vue (au cours des 30 derniers jours)
Oai Vu
Oai Vu le 18 Avr 2020
Commenté : Oai Vu le 19 Avr 2020
I'm trying to understand the purpose of this code segment
binary_data=kron(ones(1,ratio),binary_data)';
binary_data=binary_data(:);
plot(binary_data);
here ratio = sample_rate/bit_rate and binary_data is a sequence of bits which are converted from a string of text
Is it for NRZ modulation? If it is, what actually happens in detail?

Réponses (1)

Sriram Tadavarty
Sriram Tadavarty le 18 Avr 2020
Hi Oai,
The placed code just repeats the binary data by the ratio provided. It is a sort of upsampling when the binary_vector is column, and repetition of binary_vector if the input is row vector. But not NRZ modulation, since, 0 is not placed as -1.
ratio = 100;
binary_data = [1;1;0;1;0];
binary_data=kron(ones(1,ratio),binary_data)'; % This performs kronecker product and performs transpose
binary_data=binary_data(:); % This makes it to a single column vector
plot(binary_data); % Plots the code
For more details on kroncker product, look at kron page.
For simple exaplanation of what that the 3rd line in above does is below:
% Assume ratio is 2, binary data is [1;1;0]
kron([1 1],[1;0;1])' % kron([a1 a2],B) and then transpose
% This will give a matrix as such
% [a1*B a2*B] => [B B]'
% kron output is
% [1 1;
% 1 1;
% 0 0];
% Transpose the kron output
% [1 1 0;
% 1 1 0];
% Now make it column vector with command(:)
% Output is [1 1 1 1 0 0]'
% For a case of row vector [1 1 0]
% Output is
% [1 1 0 1 1 0]'
Hope this helps.
Regards,
Sriram
  1 commentaire
Oai Vu
Oai Vu le 19 Avr 2020
Thank you very much for your help!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Standard File Formats dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by