Depending on the chosen window and mode, the magnitude of the
impulse response in time-domain previously was to low. This can
be explained by looking at the signal processing. For example,
in bandpass mode with normal window, it applies a 101 point Kaiser
window (shape factor 6) and zero-pads to do a 256 point IFFT.
Therefore, the loss is 20*log10(256/sum(kaiser(101,6))) ≈ 14.2 dB.
This change compensates the signal processing losses in bandpass
and lowpass impulse mode depending on the window type, which makes
the time-domain results similar to other VNAs.
!!!!! Don`t understand why si5351 non stable on band 2 then change from band 3
It fixed if set before sweep one frequency from band 1 (for example 50MHz)
Possibly problem in tlv320aic3204_set_gain, call only si5351_set_frequency_with_offset not work
Little faster call command from shell
Fix interpolation if points < POINTS_COUNT
In plot.c prepare for 8bit/pixel mode (test, allow increase cell buffer size by use 4 or 8bit/pixel mode, but not need for now)
main.c little change wait execute shell command in sweep thread
Usage: usage: color {id} {rgb24}
- Grid color: id = -3
- Menu bg color: id = -2
- Selected menu: id = -1
- Trace 1-4: id = 0..3
Color in hex RGB format (but possible any type input, dec, hex, bin. oct)
It allow:
- reduce shell thread stack size
- more compact code
- fix some hardcoded scan command code, allow write better scan version
- run calibrate (not depend from pause sweep flag)
Rewrite uint32_t my_atoui(const char *p), now its allow read:
hex 0xaAbBcC1122
dec 12345678
bin 0b00011100
oct 0o12345678
Add some comments
(For faster screen update on marker move, all old area update info invalidate after use draw_all_cells(TRUE) on page switch)
Force redraw all cells after end marker move
#define FREQ_MODE_START_STOP 0x0
#define FREQ_MODE_CENTER_SPAN 0x1
Now sweep mode not defined from frequency0 > frequency1 or frequency0 < frequency1
frequency0 always < frequency1
All freq must get by use get_sweep_frequency(mode)
Revert Select CH0 reflect channel before set freq, add additional delay on 0 sweep point
Use int64_t acc for values
Use double on calculation
Not cache freq on si5351_set_frequency_with_offset (to fast change in rare cases on cw mode, and process wrong DSP block) as i write before need change DSP delay tactic
Little code optimization
Add commented 600kHz I2C bus timings (work, give x1.5 speed, but need change DSP ready timings not by wait_count, need use chVTGetSystemTimeX() its better)
DSP_START(delay)
//================================================
// Place some code thats need execute while delay
//================================================
DSP_WAIT_READY
Fix Band table description
Add power stabilization delay on sweep start
Start/stop generation feature (unstable on segment scan from CPU)
Calibration on paused sweep (need more stack, need find better solution)
Variable use optimization
Cleanup and optimize code
Add comments, fix definitions
Fix rounding errors
Fix band 1 stability
mcuconf.h
Set I2C bus clock to SYSCLK (more fast)
Apply 400kHz bus I2C clock timings for 8MHz and 48Mhz clock
main.c
Remove and reset some variables
Add separate sweep for calibration (allow calibrate if sweep paused)
Increase main thread stack (need for run calibrate, possibly need execute some commands in sweep threads for reduce stack usage)
Improve sweep speed about 60%
Stop generation on pause sweep
Remove all hack for si5351
Reduce code size
Fix integer overflow on big freq values
Additional
Change I2C
Others:
move marker_tracking variable to ui config
move some definition to correct place
reduce tlv320aic3204 code size
Speedup marker move from lever (BUTTON_REPEAT_TICKS = 625)
Need test stability