mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-07-07 03:53:18 -04:00
MIMO: plugins update
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// (at your option) any later version. //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "beamsteeringcwmodstreamsource.h"
|
||||
|
||||
BeamSteeringCWModStreamSource::BeamSteeringCWModStreamSource() :
|
||||
m_amp(0.5f)
|
||||
{
|
||||
m_real = m_amp;
|
||||
m_imag = 0.0f;
|
||||
}
|
||||
|
||||
BeamSteeringCWModStreamSource::~BeamSteeringCWModStreamSource()
|
||||
{}
|
||||
|
||||
void BeamSteeringCWModStreamSource::setPhase(float phase)
|
||||
{
|
||||
float normPhase = phase < -M_PI ? -M_PI : phase > M_PI ? M_PI : phase;
|
||||
m_real = m_amp * cos(normPhase);
|
||||
m_imag = m_amp * sin(normPhase);
|
||||
}
|
||||
|
||||
void BeamSteeringCWModStreamSource::pull(SampleVector::iterator begin, unsigned int nbSamples)
|
||||
{
|
||||
std::fill(begin, begin + nbSamples, Sample{m_real, m_imag});
|
||||
}
|
||||
|
||||
void BeamSteeringCWModStreamSource::pullOne(Sample& sample)
|
||||
{
|
||||
sample.setReal(m_real);
|
||||
sample.setImag(m_imag);
|
||||
}
|
||||
|
||||
void BeamSteeringCWModStreamSource::reset()
|
||||
{}
|
||||
Reference in New Issue
Block a user