1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 08:04:49 -05:00

ATV Modulator: implement SSB filter

This commit is contained in:
f4exb 2017-03-15 05:24:02 +01:00
parent abd463d374
commit fe66703954
2 changed files with 18 additions and 1 deletions

View File

@ -39,6 +39,7 @@ const float ATVMod::m_spanLevel = 0.7f;
const int ATVMod::m_levelNbSamples = 10000; // every 10ms
const int ATVMod::m_nbBars = 6;
const int ATVMod::m_cameraFPSTestNbFrames = 100;
const int ATVMod::m_ssbFftLen = 1024;
ATVMod::ATVMod() :
m_modPhasor(0.0f),
@ -54,7 +55,9 @@ ATVMod::ATVMod() :
m_videoEOF(false),
m_videoOK(false),
m_cameraIndex(-1),
m_showOverlayText(false)
m_showOverlayText(false),
m_SSBFilter(0),
m_SSBFilterBuffer(0)
{
setObjectName("ATVMod");
scanCameras();
@ -65,6 +68,10 @@ ATVMod::ATVMod() :
m_config.m_atvModInput = ATVModInputHBars;
m_config.m_atvStd = ATVStdPAL625;
m_SSBFilter = new fftfilt(0, m_config.m_rfBandwidth / m_config.m_outputSampleRate, m_ssbFftLen);
m_SSBFilterBuffer = new Complex[m_ssbFftLen>>1]; // filter returns data exactly half of its size
memset(m_SSBFilterBuffer, 0, sizeof(Complex)*(m_ssbFftLen>>1));
applyStandard();
m_interpolatorDistanceRemain = 0.0f;
@ -583,6 +590,10 @@ void ATVMod::apply(bool force)
m_tvSampleRate = m_config.m_outputSampleRate;
}
m_SSBFilter->create_filter(0, m_config.m_rfBandwidth / m_config.m_outputSampleRate);
memset(m_SSBFilterBuffer, 0, sizeof(Complex)*(m_ssbFftLen>>1));
m_SSBFilterBufferIndex = 0;
applyStandard(); // set all timings
m_settingsMutex.unlock();
}

View File

@ -31,6 +31,7 @@
#include "dsp/nco.h"
#include "dsp/interpolator.h"
#include "dsp/movingaverage.h"
#include "dsp/fftfilt.h"
#include "util/message.h"
class ATVMod : public BasebandSampleSource {
@ -530,6 +531,11 @@ private:
std::string m_overlayText;
bool m_showOverlayText;
fftfilt* m_SSBFilter;
Complex* m_SSBFilterBuffer;
int m_SSBFilterBufferIndex;
static const int m_ssbFftLen;
static const float m_blackLevel;
static const float m_spanLevel;
static const int m_levelNbSamples;