minor variable changes

demodulated frequency still shifted by about half?
This commit is contained in:
Charles J. Cliffe 2014-11-08 18:48:03 -05:00
parent 6c1ec6eba2
commit 5554c92199
2 changed files with 7 additions and 7 deletions

View File

@ -109,10 +109,10 @@ TestGLCanvas::TestGLCanvas(wxWindow *parent, int *attribList) :
wxFULL_REPAINT_ON_RESIZE), parent(parent) {
frequency = 170000;
resample_ratio = (float) frequency / (float) SRATE;
bandwidth = 800000;
resample_ratio = (float) (bandwidth) / (float) SRATE;
audio_frequency = 44000;
audio_resample_ratio = (float) audio_frequency / (float) frequency;
audio_resample_ratio = (float) (audio_frequency) / (float) bandwidth;
int in_block_size = BUF_SIZE / 2;
@ -182,7 +182,7 @@ TestGLCanvas::TestGLCanvas(wxWindow *parent, int *attribList) :
firdespm_run(n, num_bands, bands, des, weights, wtype, btype, h);
*/
float fc = 0.5f * (frequency / SRATE); // filter cutoff frequency
float fc = 0.5f * (bandwidth / SRATE); // filter cutoff frequency
float ft = 0.05f; // filter transition
float As = 60.0f; // stop-band attenuation [dB]
float mu = 0.0f; // fractional timing offset
@ -211,7 +211,7 @@ TestGLCanvas::TestGLCanvas(wxWindow *parent, int *attribList) :
msresamp_crcf_print(audio_resampler);
float kf = 0.2f; // modulation factor
float kf = 0.1f; // modulation factor
fdem = freqdem_create(kf);
freqdem_print(fdem);
@ -443,7 +443,7 @@ void TestGLCanvas::setData(std::vector<signed char> *data) {
for (i = 0; i < num_written; i++) {
freqdem_demodulate(fdem, resampled_output[i], &pcm);
resampled_output[i].real = (float) pcm/2.0;
resampled_output[i].real = (float) pcm;
resampled_output[i].imag = 0;
if (waveform_ceil < resampled_output[i].real) {

View File

@ -84,7 +84,7 @@ private:
ALCcontext *ctx;
ALuint source, buffers[AL_NUM_BUFFERS];
ALuint frequency;
ALuint bandwidth;
ALuint audio_frequency;
float audio_resample_ratio;
ALenum format;