EU1KY AA
spectr.c File Reference
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include "arm_math.h"
#include <complex.h>
#include "LCD.h"
#include "touch.h"
#include "font.h"
#include "config.h"
#include "ff.h"
#include "crash.h"
#include "dsp.h"
#include "gen.h"
#include "oslfile.h"
#include "stm32746g_discovery_lcd.h"
#include "screenshot.h"
#include "panvswr2.h"
#include "panfreq.h"
#include "textbox.h"
#include "spectr.h"
#include "fftwnd.h"

Macros

#define Fieldw1   70
 
#define FieldH   36
 

Functions

void GEN_SetLOFreq (uint32_t frqu1)
 
unsigned long GetUpper (int i)
 
unsigned long GetLower (int i)
 
static void Calc_fft_audiobuf (int ch)
 
int CalcMaxBin (unsigned long frqu1)
 
void FX_ShowResult (void)
 
void SetUpperLower (void)
 
int OneBandExec (void)
 
int ScanFull (void)
 
void Full (void)
 
int OneBand (void)
 
void HamBandsExec (void)
 
void HamBands (void)
 
void SCExit (void)
 
void freq (void)
 
void Test (void)
 
int Delta (int binMax0, int binMax1, int binMax2)
 
void ShowSpectLine (int x)
 
int SpectrumExec (int graph)
 
void Spectrum (void)
 
void Auto (void)
 
void SPECTR_FindFreq (void)
 

Variables

int16_t audioBuf [(NSAMPLES+NDUMMY)*2]
 
float rfft_mags [NSAMPLES/2]
 
float rfft_input [NSAMPLES]
 
float rfft_output [NSAMPLES]
 
const float complex * prfft
 
float windowfunc [NSAMPLES]
 
const uint32_t Scale_Factors [] ={10,8,10,10,8,10,10,8,10,10,8,10,10,8,10,10}
 
static int16_t maxMag
 
static int16_t mag
 
static int m
 
static int AreaSelected
 
static int cycl3
 
static unsigned long upper
 
static unsigned long lower
 
static BANDSPAN span
 
static int selector
 
static int sExit
 
static int auto1
 
static int sScan_Meas
 
static int sRepaint
 
static LCDPoint pt
 
static int FreqFound
 
static uint32_t f1
 
static unsigned long actFreq
 
static uint32_t power00
 
static float SumVal
 
static float Maxmag
 
static float Average
 
static int counter
 
static char string1 [40]
 
static unsigned long fx
 
static int binx
 
static int found
 
static int test
 
static const int dBs [] ={10,0,-10,-20,-30,-40,-50,-60,-70}
 
static float signal
 
static int breaker
 
static const TEXTBOX_t tb_Scan []
 

Macro Definition Documentation

#define FieldH   36
#define Fieldw1   70

Function Documentation

void Auto ( void  )
static void Calc_fft_audiobuf ( int  ch)
static
int CalcMaxBin ( unsigned long  frqu1)
int Delta ( int  binMax0,
int  binMax1,
int  binMax2 
)
void freq ( void  )
void Full ( void  )
void FX_ShowResult ( void  )
void GEN_SetLOFreq ( uint32_t  frqu1)
unsigned long GetLower ( int  i)
unsigned long GetUpper ( int  i)
void HamBands ( void  )
void HamBandsExec ( void  )
int OneBand ( void  )
int OneBandExec ( void  )
int ScanFull ( void  )
void SCExit ( void  )
void SetUpperLower ( void  )
void ShowSpectLine ( int  x)
void SPECTR_FindFreq ( void  )
void Spectrum ( void  )
int SpectrumExec ( int  graph)
void Test ( void  )

Variable Documentation

unsigned long actFreq
static
int AreaSelected
static
int16_t audioBuf[(NSAMPLES+NDUMMY)*2]
int auto1
static
float Average
static
int binx
static
int breaker
static
int counter
static
int cycl3
static
const int dBs[] ={10,0,-10,-20,-30,-40,-50,-60,-70}
static
uint32_t f1
static
int found
static
int FreqFound
static
unsigned long fx
static
unsigned long lower
static
int m
static
int16_t mag
static
int16_t maxMag
static
float Maxmag
static
uint32_t power00
static
const float complex* prfft
LCDPoint pt
static
float rfft_input[NSAMPLES]
float rfft_mags[NSAMPLES/2]
float rfft_output[NSAMPLES]
const uint32_t Scale_Factors[] ={10,8,10,10,8,10,10,8,10,10,8,10,10,8,10,10}
int selector
static
int sExit
static
float signal
static
BANDSPAN span
static
int sRepaint
static
int sScan_Meas
static
char string1[40]
static
float SumVal
static
const TEXTBOX_t tb_Scan[]
static
Initial value:
= {
(TEXTBOX_t){ .x0 = 2, .y0 = 60, .text = "Full Scale", .font = FONT_FRANBIG, .width = 120, .height = FieldH, .center = 1,
.border = 1, .fgcolor = LCD_WHITE, .bgcolor = LCD_BLACK, .cb = (void(*)(void))Full, .cbparam = 1, .next = (void*)&tb_Scan[1] },
(TEXTBOX_t){ .x0 = 2, .y0 = 110, .text = "Ham Bands", .font = FONT_FRANBIG, .width = 120, .height = FieldH, .center = 1,
.border = 1, .fgcolor = LCD_WHITE, .bgcolor = LCD_BLACK, .cb = (void(*)(void))HamBands, .cbparam = 1, .next = (void*)&tb_Scan[2] },
(TEXTBOX_t){ .x0 = 2, .y0 = 234, .text = "Exit", .font = FONT_FRANBIG, .width = 70, .height = FieldH, .center = 1,
.border = 1, .fgcolor = LCD_WHITE, .bgcolor = LCD_RED, .cb = (void(*)(void))SCExit, .cbparam = 1, .next =(void*)&tb_Scan[3] },
(TEXTBOX_t){ .x0 = 80, .y0 = 234, .text = "Auto", .font = FONT_FRANBIG, .width = 70, .height = FieldH, .center = 1,
.border = 1, .fgcolor = LCD_WHITE, .bgcolor = LCD_BLACK, .cb = (void(*)(void))Auto, .cbparam = 1, .next =(void*)&tb_Scan[4]},
(TEXTBOX_t){ .x0 = 160, .y0 = 234, .text = "Frequency", .font = FONT_FRANBIG, .width = 120, .height = FieldH, .center = 1,
.border = 1, .fgcolor = LCD_WHITE, .bgcolor = LCD_BLACK, .cb = (void(*)(void))freq, .cbparam = 1, .next =(void*)&tb_Scan[5]},
(TEXTBOX_t){ .x0 = 2, .y0 = 160, .text = "One Band", .font = FONT_FRANBIG, .width = 120, .height = FieldH, .center = 1,
.border = 1, .fgcolor = LCD_WHITE, .bgcolor = LCD_BLACK, .cb = (void(*)(void))OneBand, .cbparam = 1, .next =(void*)&tb_Scan[6]},
(TEXTBOX_t){ .x0 = 290, .y0 = 234, .text = "Test", .font = FONT_FRANBIG, .width = 58, .height = FieldH, .center = 1,
.border = 1, .fgcolor = LCD_WHITE, .bgcolor = LCD_BLACK, .cb = (void(*)(void))Test, .cbparam = 1, .next =(void*)&tb_Scan[7]},
(TEXTBOX_t){ .x0 = 352, .y0 = 234, .text = "Spectrum", .font = FONT_FRANBIG, .width = 126, .height = FieldH, .center = 1,
.border = 1, .fgcolor = LCD_WHITE, .bgcolor = LCD_BLACK, .cb = (void(*)(void))Spectrum, .cbparam = 1,},
}
Definition: textbox.h:15
Definition: LCD.h:38
void Auto(void)
Definition: spectr.c:809
void Spectrum(void)
Definition: spectr.c:777
void freq(void)
Definition: spectr.c:363
void Test(void)
Definition: spectr.c:396
void SCExit(void)
Definition: spectr.c:356
uint16_t x0
Definition: textbox.h:22
void Full(void)
Definition: spectr.c:232
void HamBands(void)
Definition: spectr.c:332
Definition: font.h:18
#define FieldH
Definition: spectr.c:47
int OneBand(void)
Definition: spectr.c:253
Definition: LCD.h:40
Definition: LCD.h:46
static const TEXTBOX_t tb_Scan[]
Definition: spectr.c:824
void(Delete(void))
Definition: mainwnd.c:360
int test
static
unsigned long upper
static
float windowfunc[NSAMPLES]