MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / getChannelAt

Method getChannelAt

src/sdr/SDRPostThread.cpp:128–139  ·  view source on GitHub ↗

Find the channelizer channel that corresponds to the given frequency

Source from the content-addressed store, hash-verified

126
127// Find the channelizer channel that corresponds to the given frequency
128int SDRPostThread::getChannelAt(long long frequency_in) {
129 int chan = -1;
130 long long minDelta = sampleRate;
131 for (int i = 0; i < numChannels+1; i++) {
132 long long fdelta = abs(frequency_in - chanCenters[i]);
133 if (fdelta < minDelta) {
134 minDelta = fdelta;
135 chan = i;
136 }
137 }
138 return chan;
139}
140
141
142void SDRPostThread::setChannelizerType(SDRPostThreadChannelizerType chType) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected