mirror of
https://github.com/ttrftech/NanoVNA.git
synced 2026-04-05 06:25:36 +00:00
Fix timedomain transform (based on acd944d5fa by @erikkaashoek )
This commit is contained in:
parent
e89c9bd6a7
commit
1120d5c33b
4 changed files with 70 additions and 45 deletions
4
plot.c
4
plot.c
|
|
@ -702,12 +702,12 @@ trace_get_info(int t, char *buf, int len)
|
|||
}
|
||||
|
||||
static float time_of_index(int idx) {
|
||||
return 1.0 / (float)(frequencies[1] - frequencies[0]) / 128.0 * idx;
|
||||
return 1.0 / (float)(frequencies[1] - frequencies[0]) / (float)FFT_SIZE * idx;
|
||||
}
|
||||
|
||||
static float distance_of_index(int idx) {
|
||||
#define SPEED_OF_LIGHT 299792458
|
||||
float distance = ((float)idx * (float)SPEED_OF_LIGHT) / ( (float)(frequencies[1] - frequencies[0]) * 128.0 * 2.0);
|
||||
float distance = ((float)idx * (float)SPEED_OF_LIGHT) / ( (float)(frequencies[1] - frequencies[0]) * (float)FFT_SIZE * 2.0);
|
||||
return distance * (velocity_factor / 100.0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue