- #1
Nate Duong
- 126
- 3
I have 2 data files, which links are attached below:
Transmitted data
https://www.dropbox.com/s/0nmhw6mpgh7upmv/TX.dat?dl=0
Received data
https://www.dropbox.com/s/xgyo6le3bcmd25r/RX.dat?dl=0
Those binary data are read by this MATLAB code:
%% initial values:
nsamps = inf;
nstart = 0;
%% input files
file_tx = 'test1-qpsk-8-8000.0-ksps.dat';
file_rx_tx_on = 'tx30-rx50-2017-03-29-14.48.56-utc.dat';
%% read files
x_tx = readcplx(file_tx, nsamps,nstart);
x_rx_on = readcplx(file_rx_tx_on, nsamps,nstart);
correlation = xcorr(x_tx,x_rx_on);
%% readcplx function:
function x = readcplx(filename,nsamps,nstart);
fid = fopen(filename);
fseek(fid,4 * nstart,'bof');
y = fread(fid,[2,inf],'short');
fclose(fid);
x = complex(y(1,:),y(2,: ) );
So, how can I perform Time Delay Estimation? Cross-correlation is the method to get time delay, but I still do not understand how.
Also, I am trying to look at these 2 signal in the spectrogram, but when I have images, I don't see them similar. they are supposed to be similar.
figure,
spectrogram(x_tx ,'yaxis'); title('transmitted file')
figure,
spectrogram(x_rx_on,'yaxis'); title('Received file')
I hope you can help me to understand this problem.
Transmitted data
https://www.dropbox.com/s/0nmhw6mpgh7upmv/TX.dat?dl=0
Received data
https://www.dropbox.com/s/xgyo6le3bcmd25r/RX.dat?dl=0
Those binary data are read by this MATLAB code:
%% initial values:
nsamps = inf;
nstart = 0;
%% input files
file_tx = 'test1-qpsk-8-8000.0-ksps.dat';
file_rx_tx_on = 'tx30-rx50-2017-03-29-14.48.56-utc.dat';
%% read files
x_tx = readcplx(file_tx, nsamps,nstart);
x_rx_on = readcplx(file_rx_tx_on, nsamps,nstart);
correlation = xcorr(x_tx,x_rx_on);
%% readcplx function:
function x = readcplx(filename,nsamps,nstart);
fid = fopen(filename);
fseek(fid,4 * nstart,'bof');
y = fread(fid,[2,inf],'short');
fclose(fid);
x = complex(y(1,:),y(2,: ) );
So, how can I perform Time Delay Estimation? Cross-correlation is the method to get time delay, but I still do not understand how.
Also, I am trying to look at these 2 signal in the spectrogram, but when I have images, I don't see them similar. they are supposed to be similar.
figure,
spectrogram(x_tx ,'yaxis'); title('transmitted file')
figure,
spectrogram(x_rx_on,'yaxis'); title('Received file')
I hope you can help me to understand this problem.