rm a bunch of wav and raw files not needed for tests

ms-warning-cleanup-2
drowe67 2023-07-13 12:26:35 +09:30 committed by David Rowe
parent 2e89c91d45
commit 141f3862d7
31 changed files with 3 additions and 81 deletions

View File

@ -381,10 +381,10 @@ endif()
add_test(NAME test_codec2_700c_octave_port
COMMAND sh -c "
cd ${CMAKE_CURRENT_BINARY_DIR}/src;
./c2sim ${CMAKE_CURRENT_SOURCE_DIR}/raw/cq_ref.raw --phase0 --postfilter --dump cq_ref --lpc 10 --dump_pitch_e cq_ref_pitche.txt;
cd ${CMAKE_CURRENT_BINARY_DIR}/unittest; ./tnewamp1 ${CMAKE_CURRENT_SOURCE_DIR}/raw/cq_ref.raw;
./c2sim ${CMAKE_CURRENT_SOURCE_DIR}/raw/hts1a.raw --phase0 --postfilter --dump hts1a --lpc 10 --dump_pitch_e hts1a_pitche.txt;
cd ${CMAKE_CURRENT_BINARY_DIR}/unittest; ./tnewamp1 ${CMAKE_CURRENT_SOURCE_DIR}/raw/hts1a.raw;
cd ${CMAKE_CURRENT_SOURCE_DIR}/octave;
DISPLAY=\"\" octave-cli -qf --eval 'tnewamp1(\"${CMAKE_CURRENT_BINARY_DIR}/src/cq_ref\", \"${CMAKE_CURRENT_BINARY_DIR}/unittest\")'")
DISPLAY=\"\" octave-cli -qf --eval 'tnewamp1(\"${CMAKE_CURRENT_BINARY_DIR}/src/hts1a\", \"${CMAKE_CURRENT_BINARY_DIR}/unittest\")'")
set_tests_properties(test_codec2_700c_octave_port PROPERTIES PASS_REGULAR_EXPRESSION "fails: 0")
# -------------------------------------------------------------------------

View File

@ -1,78 +0,0 @@
% hf_sim.m
% David Rowe March 2014
%
% Two path CCIR poor HF channel simulation, with apaologies to PathSim
% Init HF channel model from stored sample files of spreading signal ----------------------------------
global spread;
global spread_2ms;
global hf_gain;
% convert "spreading" samples from 1kHz carrier at Fs to complex
% baseband, generated by passing a 1kHz sine wave through PathSim with
% the ccir-poor model, enabling one path at a time. Because I'm too
% lazy to generate my own spreading signals
Fc = 1000; Fs=8000;
fspread = fopen("../raw/sine1k_2Hz_spread.raw","rb");
spread1k = fread(fspread, "int16")/10000;
fclose(fspread);
fspread = fopen("../raw/sine1k_2ms_delay_2Hz_spread.raw","rb");
spread1k_2ms = fread(fspread, "int16")/10000;
fclose(fspread);
% down convert to complex baseband
spreadbb = spread1k.*exp(-j*(2*pi*Fc/Fs)*(1:length(spread1k))');
spreadbb_2ms = spread1k_2ms.*exp(-j*(2*pi*Fc/Fs)*(1:length(spread1k_2ms))');
% remove -2000 Hz image
b = fir1(50, 5/Fs);
spread = filter(b,1,spreadbb);
spread_2ms = filter(b,1,spreadbb_2ms);
% discard first 1000 samples as these were near 0, probably as
% PathSim states were ramping up
spread = spread(1000:length(spread));
spread_2ms = spread_2ms(1000:length(spread_2ms));
hf_gain = 1.0/sqrt(var(spread)+var(spread_2ms));
% This function simulates the HF channel at 8kHz for real signals. A
% good use case is passing a vector of speech samples through it to
% simulate SSB over HF. There's a really good reason for the 300 -
% 3000 Hz filter that escapes me right now :-)
function [sim_out snr3kHz_measured ] = hf_sim_real(sim_in, snr3kHz)
% 300 - 3000 Hz filter
b = fir1(100,[300/4000, 3000/4000], 'pass');
% det power of unit variance noise passed through this filter
filter_var = var(filter(b,1,randn(1000,1)));
% Start simulation
s = hilbert(filter(b,1,sim_in));
n1 = length(s); n2 = length(spread);
n = min(n1,n2);
path1 = s(1:n) .* spread(1:n);
path2 = s(1:n) .* spread_2ms(1:n);
delay = floor(0.002*Fs);
combined = path1(delay+1:n) + path2(1:n-delay);
snr = 10 .^ (snr3kHz/10);
variance = (combined'*combined)/(snr*n);
noise = sqrt(variance*0.5/filter_var)*(randn(n-delay,1) + j*randn(n-delay,1));
filtered_noise = filter(b,1,noise);
sim_out = real(combined+filtered_noise);
snr3kHz_measured = 10*log10(var(real(combined))/var(real(filtered_noise)));
endfunction

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.