the purpose of this code segment
1 回表示 (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
回答 (1 件)
Sriram Tadavarty
2020 年 4 月 18 日
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 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
参考
カテゴリ
Help Center および File Exchange で Standard File Formats についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!