Complex vector conversion to binary bits using quantizer
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Muhammad Faheem Awan
am 31 Okt. 2018
Kommentiert: Muhammad Faheem Awan
am 9 Jul. 2019
I have a complex vector 1601*1. I want to Quantize this vector into binary bits using some quantizer by selecting different threshold regions.
0 Kommentare
Akzeptierte Antwort
Abhishek Kumar
am 9 Jul. 2019
It would be easier if you could give an example of want is your input and what is your expected output.
Below is an example which shows you how to convert a complex number to binary.
clear; clc; close all;
% a complex number
x=0.3435637634857634+1i*0.66735646778675;
% parameters for fixed point conversion
wordLength=15;
sign=0; % unsigned numbers
fractionalPart=14;
% covertion to fixed point
X=fi(x,sign,wordLength, fractionalPart);
% how to access values
Xre=real(X);
disp('binary word: '); disp(Xre.bin); fprintf('\n');
disp('real world value, as a string: '); disp(Xre.Value); fprintf('\n');
disp('fixed point value: '); disp(Xre.data); fprintf('\n');
% comparison with floating arithmetic values
disp('----------------');
disp('rounding error: ')
disp( X.data-x )
Here are a few links which should remove any further doubts.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Cast and Quantize Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!