v04-script add hex output

This commit is contained in:
thfu 2024-11-23 11:56:18 +08:00
parent bcfd586b53
commit 5f68519f8d
1 changed files with 14 additions and 7 deletions

View File

@ -17,9 +17,9 @@ cs_wave(2:4:4*N) = dout1;
cs_wave(3:4:4*N) = dout2;
cs_wave(4:4:4*N) = dout3;
A = [0.025 0.015 0.0002 0.2];
tau = -[1/250 1/650 1/1600 1/20];
fs = 0.375e9;
A = [0.025 0.015 0.0002 0];
tau = -[1/250 1/650 1/1600 0];
fs = 2e9;
coef_len = length(A);
for i = 1:coef_len
@ -36,11 +36,11 @@ wave_float_8 = interp1(1:wave_float_len,wave_float,1:1/8:(wave_float_len+1-1/8),
[cs_wave_A,wave_float_8_A,Delay] = alignsignals(cs_wave,wave_float_8);
N = min(length(wave_float_8_A),length(cs_wave_A));
figure(2)
diff_plot(wave_float_8_A(18:end), cs_wave_A(82:end),'float','verdi',[0 N]);
diff_plot(wave_float_8_A(90:end), cs_wave_A(154:end),'float','verdi',[0 N]);
%%
[wave_float_A,wave_verdi_A,Delay] = alignsignals(wave_float,wave_verdi);
N = min(length(wave_float_A),length(wave_verdi_A));
figure(1)
figure(1)git sh
diff_plot(wave_float_A, wave_verdi_A,'float','verdi',[0 N]);
%%
signalAnalyzer(wave_float,wave_verdi,'SampleRate',1);
@ -48,6 +48,13 @@ signalAnalyzer(wave_float,wave_verdi,'SampleRate',1);
fprintf("a is %.10f\n",a)
fprintf("b is %.10f\n",b)
%%
fprintf("a of 32 bit %d\n",round(a*2^31));
fprintf("b of 32 bit %d\n",round(b*2^31));
a_fix = round(a*2^31);
b_fix = round(b*2^31);
dec2hex(a_fix,8)
dec2hex(b_fix,8)
% dec2bin(a_fix,32)
% dec2bin(b_fix,32)