max-phase2-tdma

This commit is contained in:
Max 2014-02-14 19:50:17 -05:00
parent 95bba45b02
commit 94a221e827
11 changed files with 71 additions and 5 deletions

View File

@ -20,5 +20,6 @@ install(FILES
op25_repeater_vocoder.xml
op25_repeater_gardner_costas_cc.xml
op25_repeater_p25_frame_assembler.xml
op25_repeater_fsk4_slicer_fb.xml DESTINATION share/gnuradio/grc/blocks
op25_repeater_fsk4_slicer_fb.xml
op25_repeater_p25p2_frame.xml DESTINATION share/gnuradio/grc/blocks
)

View File

@ -25,5 +25,6 @@ install(FILES
vocoder.h
gardner_costas_cc.h
p25_frame_assembler.h
fsk4_slicer_fb.h DESTINATION include/op25_repeater
fsk4_slicer_fb.h
p25p2_frame.h DESTINATION include/op25_repeater
)

View File

@ -28,14 +28,23 @@ list(APPEND op25_repeater_sources
vocoder_impl.cc
gardner_costas_cc_impl.cc
p25_frame_assembler_impl.cc
fsk4_slicer_fb_impl.cc )
fsk4_slicer_fb_impl.cc
p25p2_frame_impl.cc )
list(APPEND op25_repeater_sources
bch.cc
rs.cc
p25_framer.cc
p25p2_framer.cc
p25p2_isch.cc
p25p2_duid.cc
p25p2_sync.cc
p25p2_tdma.cc
p25p2_vf.cc
imbe_decoder.cc
software_imbe_decoder.cc
ambe.c
mbelib.c
)
add_library(gnuradio-op25_repeater SHARED ${op25_repeater_sources})

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
* Copyright 2010, 2011, 2012, 2013 KA1RBI
* Copyright 2010, 2011, 2012, 2013, 2014 Max H. Parke KA1RBI
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
* Copyright 2009, 2010, 2011, 2012, 2013 KA1RBI
* Copyright 2009, 2010, 2011, 2012, 2013, 2014 Max H. Parke KA1RBI
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -458,6 +458,11 @@ CW = (CW ^ correction) >> 11;
return CW;
}
uint32_t gly23127Dec (uint32_t CW) {
uint32_t correction = gly23127DecTbl[gly23127GetSyn(CW)];
CW = (CW ^ correction) >> 11;
return CW;
}
void ProcHDU(const_bit_vector A) {
int i, j, k, ec;

View File

@ -11,5 +11,7 @@ void ProcHDU(const_bit_vector A);
void ProcTDU(const_bit_vector A);
void ProcLDU1(const_bit_vector A);
void ProcLDU2(const_bit_vector A);
uint32_t gly24128Dec (uint32_t n) ;
uint32_t gly23127Dec (uint32_t n) ;
#endif

View File

@ -926,6 +926,49 @@ software_imbe_decoder::decode_audio(uint8_t *A)
tmp_f = Old; Old = New; New = tmp_f;
}
void
software_imbe_decoder::decode_tap(int _L, int _K, float _w0, const int * _v, const float * _mu)
{
int ell;
uint32_t ET;
float SE = 0, ER = 0;
int en, tmp_f;
L = _L;
int K = _K;
w0 = _w0;
for(ell = 1; ell <= L; ell++) {
vee[ell][ New] = _v[ell - 1];
Mu[ell][ New] = _mu[ell - 1];
}
// decode_spectral_amplitudes(Start3, Start8);
enhance_spectral_amplitudes(SE);
adaptive_smoothing(SE, ER, ET);
// (8000 samp/sec) * (1 sec / 50 compressed voice frames) = 160 samples/frame
//synth:
synth_unvoiced();// ToDo: make suv return value?
synth_voiced(); // ToDo: make sv return value?
//output:
audio_samples *samples = audio();
for(en = 0; en <= 159; en++) {
// The unvoiced samples are loud and the voiced are low...I don't know why.
// Most of the difference is compensated by removing the 146.6433 factor
// in the synth_unvoiced procedure. The final tweak is done by raising the
// voiced samples:
float sample = suv[en] + sv[en] * 4; //balance v/uv loudness
if(abs((int)sample) > 32767) {
sample = 32767 * (sample < 0) ? -1 : 1; // * sgn(sample)
}
samples->push_back((short)sample);
}
OldL = L;
Oldw0 = w0;
tmp_f = Old; Old = New; New = tmp_f;
}
void
software_imbe_decoder::decode_spectral_amplitudes(int Start3, int Start8)
{

View File

@ -51,6 +51,7 @@ public:
*/
virtual void decode(const voice_codeword& cw);
void decode_tap(int _L, int _K, float _w0, const int * _v, const float * _mu);
private:
//NOTE: Single-letter variable names are upper case only; Lower

View File

@ -45,3 +45,4 @@ GR_ADD_TEST(qa_vocoder ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_vocod
GR_ADD_TEST(qa_gardner_costas_cc ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_gardner_costas_cc.py)
GR_ADD_TEST(qa_p25_frame_assembler ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_p25_frame_assembler.py)
GR_ADD_TEST(qa_fsk4_slicer_fb ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_fsk4_slicer_fb.py)
GR_ADD_TEST(qa_p25p2_frame ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_p25p2_frame.py)

View File

@ -12,6 +12,7 @@
#include "op25_repeater/gardner_costas_cc.h"
#include "op25_repeater/p25_frame_assembler.h"
#include "op25_repeater/fsk4_slicer_fb.h"
#include "op25_repeater/p25p2_frame.h"
%}
%include "op25_repeater/vocoder.h"
@ -24,3 +25,5 @@ GR_SWIG_BLOCK_MAGIC2(op25_repeater, p25_frame_assembler);
%include "op25_repeater/fsk4_slicer_fb.h"
GR_SWIG_BLOCK_MAGIC2(op25_repeater, fsk4_slicer_fb);
%include "op25_repeater/p25p2_frame.h"
GR_SWIG_BLOCK_MAGIC2(op25_repeater, p25p2_frame);