⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frequencyscanner.h

📁 QAM module to use in Java with an easy interface and powerful performance
💻 H
字号:
//License: GNU
//
//
//
//    J-QAM sound card modem
//
//    Copyright (C) 2007-2008  Jonti Olds
//
//
//
//    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, either 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 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 "fftw3.h"

static void my_fftw_write_char(char c, void *f) { fputc(c, (FILE *) f); }
#define fftw_export_wisdom_to_file(f) fftw_export_wisdom(my_fftw_write_char, (void*) (f))
#define fftwf_export_wisdom_to_file(f) fftwf_export_wisdom(my_fftw_write_char, (void*) (f))
#define fftwl_export_wisdom_to_file(f) fftwl_export_wisdom(my_fftw_write_char, (void*) (f))

static int my_fftw_read_char(void *f) { return fgetc((FILE *) f); }
#define fftw_import_wisdom_from_file(f) fftw_import_wisdom(my_fftw_read_char, (void*) (f))
#define fftwf_import_wisdom_from_file(f) fftwf_import_wisdom(my_fftw_read_char, (void*) (f))
#define fftwl_import_wisdom_from_file(f) fftwl_import_wisdom(my_fftw_read_char, (void*) (f))

#pragma link "fftw3-3.lib"
#include <vector>
#include "Constants.h"
#include "Settings.h"
#include <Math.hpp>
#include <Classes.hpp>
#include "DSP.h"
#include "Progress.h"

#ifndef FrequencyScannerH
#define FrequencyScannerH

//#define MAX_NUMBER_OF_POSIBLE_FREQS_TO_TRY      3
#define MIN_FREQ_TO_SEARCH_FOR                  1200
//---------------------------------------------------------------------------
using namespace std;

class FrequencyScanner;

class SettingsInvestigator :  public TThread
{
private:
protected:
        void __fastcall Execute();
public:
        __fastcall SettingsInvestigator(FrequencyScanner *FreqScanner,TThreadPriority tPriority);
        bool Working;
        vector<double> Data;
        void __fastcall FinshedEvent(TObject* Sender);
        bool Finished;
        FrequencyScanner *fs;
        void __fastcall ThreadTheXForm(void);
};

class FrequencyScanner
{
public:
        __fastcall DoTheXform(void);

        AnsiString str;

        void __fastcall SettingsHaveChanged(NotificationEventType WhatHasChanged);

        SettingsInvestigator *invest;

        void __fastcall SetupSoundcard();
        fftw_plan p;
        double *in, *out;
        __fastcall ~FrequencyScanner();
        __fastcall FrequencyScanner();
        int N;
        void __fastcall Update(short * Data, int size);
        int NPtr;
        vector<double> outinternalave;
        vector<double> outinternalaveworking;
        int outinternalavepos;

        double MASum;
        vector<double> MABuf;
        int MAPtr;

        double MASum2;
        vector<double> MABuf2;
        int MAPtr2;

        vector<FrequencySetting> PosibleFrequencySettings;
        int PosibleFrequencySettingsPtr;

        void __fastcall Start();
        void __fastcall LoadPosibleFrequencys();

        bool NoteForMain;

        vector<FrequencySetting> CopyOfPosibleFrequencySettings;
        int CopyOfPosibleFrequencySettingsPtr;
        int CopyOfPosibleFrequencySettingsSize;


        bool __fastcall GetNextSetting();
        void __fastcall CopyPosibleFreqSettings();

        bool WorkingSettingStillValid;
        FrequencySetting WorkingSettings;

        double SigLevel;

        int N_2;
        bool __fastcall CheckIfWorkingIsStillValid();

        int MAX_NUMBER_OF_POSIBLE_FREQS_TO_TRY;
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -