From 38352ec47b4fc9ab62677fbf4aae66569b1e9290 Mon Sep 17 00:00:00 2001 From: David Protzman Date: Tue, 26 Apr 2022 22:17:17 -0400 Subject: [PATCH] Casting bursts to double complex --- matlab/updated_scripts/extract_bursts_from_file.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/matlab/updated_scripts/extract_bursts_from_file.m b/matlab/updated_scripts/extract_bursts_from_file.m index 32db3e3..6a8c8d6 100644 --- a/matlab/updated_scripts/extract_bursts_from_file.m +++ b/matlab/updated_scripts/extract_bursts_from_file.m @@ -120,8 +120,10 @@ function [bursts] = extract_bursts_from_file(input_path, sample_rate, frequency_ bursts = zeros(length(valid_burst_indices), burst_sample_count); for idx=1:length(valid_burst_indices) - % Read in the current burst. The starting index was calculated above - burst = read_complex_floats(input_path, valid_burst_indices(idx), burst_sample_count); + % Read in the current burst. The starting index was calculated above. Force cast to a double just in case the + % samples were not read in as such. Otherwise processing that happens later on could fail since much of + % MATLAB's DSP functions require doubles + burst = double(read_complex(input_path, valid_burst_indices(idx), burst_sample_count, sample_type)); % Adjust for the user-specified frequency offset that is present in the recording and save those samples off bursts(idx,:) = burst .* freq_offset_vec;