Updated calculate channel to take the symbol number

This was to experiment with using different symbols for equalization
gr-droneid-3.8
David Protzman 2022-04-19 22:45:06 -04:00
rodzic aa2e3c3889
commit e0985e25f0
2 zmienionych plików z 8 dodań i 6 usunięć

Wyświetl plik

@ -1,15 +1,17 @@
% Calculate channel taps based on the 4th OFDM symbol (first ZC sequence)
% Calculate channel taps based on the 4th or 6th OFDM symbol (both are ZC sequences)
%
% There is almost certainly a better way to do this, but this gets the job done
%
% @param zc_seq Frequency domain ZC sequence from OFDM symbol number 4 (all FFT bins, no cyclic prefix)
% @param zc_seq Frequency domain ZC sequence from OFDM symbol number 4 or 6 (all FFT bins, no cyclic prefix)
% @param sample_rate Sample rate (in Hz) of `zc_seq`
% @return taps Result of dividing `zc_seq` into a golden reference copy of the first ZC sequence
function [taps] = calculate_channel(zc_seq, sample_rate)
% @param symbol_idx Which symbol (must be 4 or 6) is in the `zc_seq` vector
% @return taps Result of dividing `zc_seq` into a golden reference copy of the selected ZC sequence
function [taps] = calculate_channel(zc_seq, sample_rate, symbol_idx)
assert(symbol_idx == 4 || symbol_idx == 6, "Symbol index must be 4 or 6");
fft_size = get_fft_size(sample_rate);
% The golden reference needs to be in the frequency domain
gold_seq = fftshift(fft(reshape(create_zc(fft_size, 4), size(zc_seq))));
gold_seq = fftshift(fft(reshape(create_zc(fft_size, symbol_idx), size(zc_seq))));
% figure(400);
% subplot(1, 2, 1);

Wyświetl plik

@ -101,7 +101,7 @@ for burst_idx=1:size(bursts, 1)
[time_domain_symbols, freq_domain_symbols] = extract_ofdm_symbol_samples(burst, file_sample_rate);
% Calculate the channel based on the first ZC sequence which is in OFDM symbol #4
channel = calculate_channel(freq_domain_symbols(4,:), file_sample_rate);
channel = calculate_channel(freq_domain_symbols(4,:), file_sample_rate, 4);
% Place to store the demodulated bits
bits = zeros(9, 1200);