kopia lustrzana https://github.com/proto17/dji_droneid
Split the creation of the ZC sequence out from creating time domain
rodzic
20b313259c
commit
8b347811bd
|
@ -21,9 +21,7 @@ function [samples] = create_zc(fft_size, symbol_index)
|
||||||
root = 147;
|
root = 147;
|
||||||
end
|
end
|
||||||
|
|
||||||
% Would use MATLAB's zadoffChuSeq function, but Octave doesn't have that
|
zc = reshape(create_zc_seq(fft_size, root), [], 1);
|
||||||
% The logic below was tested against the MATLAB function
|
|
||||||
zc = reshape(exp(-1j * pi * root * (0:600) .* (1:601) / 601), [], 1);
|
|
||||||
|
|
||||||
% Figure out how many guard carriers there should be (purposely ignoring DC here)
|
% Figure out how many guard carriers there should be (purposely ignoring DC here)
|
||||||
guard_carriers = fft_size - 600;
|
guard_carriers = fft_size - 600;
|
||||||
|
@ -39,7 +37,9 @@ function [samples] = create_zc(fft_size, symbol_index)
|
||||||
|
|
||||||
% Null out the DC carrier
|
% Null out the DC carrier
|
||||||
samples_freq(fft_size/2) = 0;
|
samples_freq(fft_size/2) = 0;
|
||||||
|
|
||||||
|
samples_freq
|
||||||
|
|
||||||
% Convert to time domain making sure to flip the spectrum left to right first
|
% Convert to time domain making sure to flip the spectrum left to right first
|
||||||
samples = ifft(fftshift(samples_freq));
|
samples = ifft(fftshift(samples_freq)) / fft_size;
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
function [zc_seq] = create_zc_seq(fft_size, root)
|
||||||
|
assert(log2(fft_size) == round(log2(fft_size)), "Invalid FFT size. Must be power of 2");
|
||||||
|
|
||||||
|
% Would use MATLAB's zadoffChuSeq function, but Octave doesn't have that
|
||||||
|
% The logic below was tested against the MATLAB function
|
||||||
|
zc_seq = exp(-1j * pi * root * (0:600) .* (1:601) / 601);
|
||||||
|
end
|
||||||
|
|
Ładowanie…
Reference in New Issue