finish coding and testing of online acq; add sample data

串行在线捕获程序已经完成编写,并进行了仿真和测试(对飞和814均可用);增加了在电子所使用转台测试的幅相采集数据
This commit is contained in:
2023-05-08 19:13:53 +08:00
parent e07389e326
commit 2d4650a3b6
2835 changed files with 408373 additions and 181193 deletions
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:da2a5e413ed5888360149258ef98042e72a3f49c6b126285c407d221206343b0
3 size 5696542
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:311cc1b3564a4da4ae7ab36b636ceca61d2e8d65e52567825399be34c10a205d
3 size 5487793
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:657cb426ba63d035ab3770f34507ce4cd5af029740ff483bff4afac61c7fe405
3 size 4953881
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:fb6a9679fcbde08a28d17d03e42f8dfdc221c1806758e3d74bd28ef146771817
3 size 4945576
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:0145e254692b5dd671b20917aaea4e2fbf4729be82979714fb09278cb1798a8a
3 size 4939528
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:dd4797a467476ed843b806dae7d7635a47160ae1c19990c253e884f4059152fa
3 size 4950262
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:581d94321adb4bb67c689698392e108e45049ca9ec24aa30461b7a2cd3d5ecb2
3 size 4955546
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:5a327fa69eca5691f0e5d7405de8f0b73e357da4b5738c814fa937d96c1ccf2e
3 size 4955228
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:bdde224a0bedcdf95e2d8eb249539cecd05005a2514c4d47f1e9fc598c323ce7
3 size 4949022
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:f16321cdcaee69fcc544a29ebe1f87fba10899b2357980539a3d4ba84b5e45ce
3 size 4948924
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:da3cb42b282f8f2455f0a59b1311b7e96c6c5780b773a19027f6ef4996d121a9
3 size 4959851
@@ -0,0 +1,44 @@
close all;
% 4 ch
fileNameList = [...
"iladata_duifei_1t2r_48msps_bw15m_trx_ext_lo_noise_1-1.csv",...
"iladata_duifei_1t2r_48msps_bw15m_trx_ext_lo_noise_1-2.csv",...
"iladata_duifei_1t2r_48msps_bw15m_trx_ext_lo_noise_1-3.csv",...
"iladata_duifei_1t2r_48msps_bw15m_trx_ext_lo_noise_2-1.csv",...
"iladata_duifei_1t2r_48msps_bw15m_trx_ext_lo_noise_2-2.csv",...
"iladata_duifei_1t2r_48msps_bw15m_trx_ext_lo_noise_2-3.csv",...
"iladata_duifei_1t2r_48msps_bw15m_trx_ext_lo_noise_3-1.csv",...
"iladata_duifei_1t2r_48msps_bw15m_trx_ext_lo_noise_3-2.csv",...
"iladata_duifei_1t2r_48msps_bw15m_trx_ext_lo_noise_3-3.csv"
];
[~,fileNum] = size(fileNameList);
maxList = strings(fileNum+1,5);
stdList = strings(fileNum+1,5);
maxList(1,:) = ["Max Value", "ch1", "ch2", "ch3", "ch4"];
maxList(2:end,1) = fileNameList;
stdList(1,:) = ["Std Value", "ch1", "ch2", "ch3", "ch4"];
stdList(2:end,1) = fileNameList;
for i = 1:fileNum
rxRaw = readmatrix(fileNameList(:,i));
[rowNum,colNum] = size(rxRaw);
if (colNum == 11)
rx = [rxRaw(:, 4)+1i*rxRaw(:, 5),rxRaw(:, 6)+1i*rxRaw(:, 7),...
rxRaw(:, 8)+1i*rxRaw(:, 9),rxRaw(:,10)+1i*rxRaw(:,11)];
elseif (colNum == 7)
rx = [rxRaw(:, 4)+1i*rxRaw(:, 5),rxRaw(:, 6)+1i*rxRaw(:, 7),...
zeros(rowNum,1),zeros(rowNum,1)];
else
disp('Invalid Data Format.')
return
end
maxList(i+1,2:end) = string(max(rx));
stdList(i+1,2:end) = string(std(rx));
end
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:e458fbc41fd1a5b2034001a7687343b2883b86a0a618255d3b8c4846d0809895
3 size 5650597
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:81d642f0d1e13578ea2268d69f489ca59f5ea2d2c2d8454ffda37e2ce18bce0f
3 size 5661088
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:82e30ec27dc9906506d5aee652c3274825dd79cf951aa6074642a480df76022d
3 size 5654010
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:7e61ed371762bd005038ab6fbd151854ed11da8739f631984c883aa402b7443d
3 size 5790693
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:de9c4e36c40fe58e9f5da8270d358d2b1c77c9f01c57a06d1bfc7fe73c1abdc6
3 size 5807862
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:d1c6329e4bdf204d94d08c14adcd1414df9d7b436f958f674ceb884e01ec0ab5
3 size 5779561
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:f7d0bdf7145fd7eabd47c0b3bae3c9d16c830cff5573221259dfb7f34815dbde
3 size 5718302
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:a523dfed0385462adb1912936a7428260128a382e7d4cc2986e0adfdec1a595f
3 size 5791888
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:b2c47e1b124d2d9d6fe06eca6fbbb230df279ae77a37c4bc3353952b1112f611
3 size 5587448
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:0345a5f189e184e8dd2424f68f1435be62874b1c4132d2ff7bd63a1ecd9b7a7d
3 size 5665045
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:c808a288e7feabce91029e523fea186a874d62e5bf1ba81a60a5b9cca555b879
3 size 5666940
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:c2b7eb4837ffd2d72c6af97f38d037553f642caa199a85625e9791bb0d4a98db
3 size 5672636
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:890f48e04b795201390612cc053a8b6bc03fcb2196762a506b94ce5277f609ee
3 size 5775388
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:7209054ac2d7006638185ad17363af9c2955badba9461152914ad47b1deca4eb
3 size 5778198
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:907fbecd573ba0948776e301276c672eeb0bace324da14e8cd1b68dec52c3b07
3 size 5774821
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:383b6951d147d64ab5557f7d1c9c8221e872fc946240e52aae63b62c7719547a
3 size 5807251
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:07a83d8cca7f02b2a9843e998f5c3123873bb53944b53a1679d2026d2580b561
3 size 5799568
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:e65ae7fc54115f5797e99cd25eb38574cf5a7b7dc3a3efc76b782adbebcf901e
3 size 5652286
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:b5b18f880d2f74d17425a1e8c34f87ce0579b6173d25518c4db131209a5a6545
3 size 5798106
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:8bb3b0421cd2708194b98615b1b1181b24b1758a74e065fb9e32a30fd4839e0e
3 size 5791475
Binary file not shown.
1 version https://git-lfs.github.com/spec/v1
2 oid sha256:1e815a440a4d2afef741a49254c75239179886f1f4d323f8eb201e8ab7bb653d
3 size 5685222
@@ -0,0 +1,86 @@
%% File Header/文件说明
%
% Beamforming with phased array derives signal characteristics from phase
% differences between sensors. Therefore the amplitude-phase consistence is
% vital to phased systems.
%
% The script analyzes the amp-phase relations of ILA captured data, the format
% of which is square-shaped pseudorandorm bit sequence. Each channel is
% processed seperately with different frequency shifts and different optimum
% sampling points. The estimation of amplitude and phase are based on
% acculumated correlation peaks.
%
clc; clear;
%% initial parameters/初始参数
interp = 8; % interpolation factor
channelNum = 4;
dataLen = 131072;
fs = 48e6;
dataFile = "iladata_duifei_1t2r_48msps_bw15m_rx_ext_lo_bpsk_2-1.csv";
% standard pn sequence
pnSequence = comm.PNSequence('Polynomial','x^7+x^6+1', ...
'InitialConditions',[zeros(1,6),1],'SamplesPerFrame',2^7-1);
PRBS7 = pnSequence();
PRBS7_polar = 1-2*[PRBS7;0];
chipLen = length(PRBS7_polar); % pn chip length
symNum = dataLen/chipLen/interp; % total symbol number
symNumPerAccum = 1; % symbol nbumber of each accumulation
accNum = symNum/symNumPerAccum; % total accumulation numbers, i.e. peak numbers
%% data analysis
% read data, and swap ch1 and ch2, because loop data locate at ch2 and ch4
rxdata = readmatrix(dataFile);
seqRx(:,1) = (rxdata(:, 6) + 1i*rxdata(:, 7)).';
seqRx(:,2) = (rxdata(:, 4) + 1i*rxdata(:, 5)).';
seqRx(:,3) = (rxdata(:, 8) + 1i*rxdata(:, 9)).';
seqRx(:,4) = (rxdata(:,10) + 1i*rxdata(:,11)).';
% compensate frequecny deviation and downsample at optimum sample position based
% on the varience of constellation
[seqRxDown,fd,samplePos] = suqareShapeFreqEst(seqRx,interp,fs,-50,50,5);
% split [seqRxDown] into multiple groups, each group contains several symbols to
% be correlated with PRBS7 and accumulated
seqRxDownSplit = reshape(seqRxDown(1:dataLen/interp,:),chipLen*symNumPerAccum, ...
accNum,channelNum);
seqRxAcc = zeros(chipLen,accNum,channelNum);
desiredPnt = zeros(accNum,channelNum);
ampEstSym = zeros(accNum,channelNum);
angleEstSym = zeros(accNum,channelNum);
for i = 1:accNum
for j = 1:channelNum
% correlation & multi-symbol accumulation
groupCorrAcc = sum(reshape(conv(flip(seqRxDownSplit(:,i,j)), ...
PRBS7_polar,'same'),chipLen,symNumPerAccum),2)';
seqRxAcc(:,i,j) = groupCorrAcc;
% peak position
desiredPnt(i,j) = groupCorrAcc(abs(groupCorrAcc)==max(abs(groupCorrAcc)));
end
end
for i = 1:channelNum
ampEstSym(:,i) = abs(desiredPnt(:,i))./abs(desiredPnt(:,1));
angleEstSym(:,i) = mod((angle(desiredPnt(:,i))-angle(desiredPnt(:,1)))/pi*180,360);
end
%% figures
figure(1);
subplot(121);
plot(ampEstSym(:,[1,4]));
legend({"ch1","ch4"});
title("Amplitude Estimation");
ylim([min(ampEstSym(:,[1,4]),[],'all')-0.1,max(ampEstSym(:,[1,4]),[],'all')+0.1]);
grid on; grid minor;
subplot(122);
plot(angleEstSym(:,[1,4]));
legend({"ch1","ch4"});
title("Angle Estimation");
ylim([min(angleEstSym(:,[1,4]),[],'all')-1,max(angleEstSym(:,[1,4]),[],'all')+1]);
grid on; grid minor;
@@ -0,0 +1,50 @@
function [dataOut, fdTarget, samplePosTarget] = suqareShapeFreqEst(dataIn, interp, fs, fmin, fmax, fd)
%suqareShapeFreqEst - 利用星座图的集中程度在一定频率范围内使用频率步进估计方波成形信号的频偏
%
% data - input complex data, row vector
% dataLen - data length
% interp - interpolation rate
% fs - sampling rate, in Herts
% fmin - minimum estimation frequency, in Herts
% fmax - maximum estimation frequency, in Herts
% fd - estimation frequency step, in Herts
% dimension
[dataLen,channelNum] = size(dataIn);
freqList = fmin:fd:fmax;
freqNum = length(freqList);
varRecord = zeros(freqNum,interp);
dataOut = zeros(dataLen/interp,channelNum);
fdTarget = zeros(channelNum,1);
samplePosTarget = zeros(channelNum,1);
for channel = 1:channelNum
for freq = 1:freqNum
% carrier
cxr = exp(-1i*2*pi*freqList(freq)/fs*(0:dataLen-1)');
% apply frequency shift onto input data
seqRx = dataIn(:,channel).*cxr;
for samplePos = 0:interp-1
seqRxDown = downsample(seqRx,interp,samplePos); % 下采样
seqRxDownQuaterOne = abs(real(seqRxDown)) + 1i*abs(imag(seqRxDown)); % 集中到第一象限
varRecord(freq,samplePos+1) = var(seqRxDownQuaterOne);
end
end
[fdIndex, samplePosIndex] = find(varRecord==min(min(varRecord)));
fdTarget(channel) = freqList(fdIndex);
samplePosTarget(channel) = samplePosIndex-1;
cxrTarget = exp(-1i*2*pi*fdTarget(channel)/fs*(0:dataLen-1)');
seqRxTarget = dataIn(:,channel).*cxrTarget;
dataOut(:,channel) = downsample(seqRxTarget,interp,samplePosTarget(channel));
end
end