Commit Graph

137 Commits

Author SHA1 Message Date
geraldfournier 1c0bc1d5c9 make fft scaling independent from rounding behaviour for odd data 2026-03-06 16:34:20 +01:00
Holger Vogt 32e0d5f12f Revert "make fft scaling independent from rounding behaviour for odd data"
This reverts commit a31ac54200.
2026-03-06 16:31:29 +01:00
dwarning a31ac54200 make fft scaling independent from rounding behaviour for odd data 2026-03-05 09:30:55 +01:00
dwarning b522bcc6c0 correct Nyquist bin scaling for Green branch 2026-03-03 20:39:08 +01:00
dwarning ad44b4ff4c let nyquist bin not empty for odd vector 2026-03-03 18:32:32 +01:00
dwarning a0dc0bb608 Special Nyquist scaling only for even length 2026-03-03 09:55:57 +01:00
dwarning 6ae057b3ea revert commit 5e82b63 2026-03-03 08:54:03 +01:00
dwarning d2b1ecbb23 correct fft scaling at Nyquist freq. in fft cmd and vector operation 2026-03-01 16:18:24 +01:00
dwarning 5e82b63f62 adapt FFT point number for real input vectors in fft cmd and vector operation wrt. bug #829 2026-03-01 16:14:04 +01:00
Holger Vogt 26c86841df Remove compiler warnings 2026-02-03 15:20:05 +01:00
Holger Vogt 14363ba45a Moving window filtering with function 'newvec = mtimeavg(vec)'
Window of fixed time width given by 'set mtimeavgwindow=400u'
Length and scale of newvec resembles the original vetor vec.
Large vec and large mtimeavgwindow take their time.
OpenMP is used if available.
2026-01-20 15:24:52 +01:00
Holger Vogt 66dfc915e9 Add a function m3avg(vector) for filtering of trap ringing.
Moving average with D(n) = (C(n-1)/2 + C(n) + C(n+1)/2)/2
2025-12-28 23:19:58 +01:00
dwarning adaa3d39fc no use for grouping in cx_fft and cx_ifft 2024-02-16 13:56:43 +01:00
dwarning 2cf2693706 few code cleanings 2023-11-12 17:04:36 +01:00
dwarning 794a37339a ifft: in case input array is smaller then output array - fill in the rest with zero to prevent uninitialzed plot variables 2023-07-15 11:32:11 +02:00
dwarning 42b803e5c2 same array size for in- and output in inverse fft function from fftw3 2023-07-15 11:31:59 +02:00
Holger Vogt 0ee5e3f32a Add a control language function cvector, to create a complex vector.
Let vec1 = cvector(50)
will generate a complex vector, with the real part values
increasing from 0 to 49, the imaginary values are set to 0.
Useful in ac loops to store result data.
2023-07-15 11:17:10 +02:00
Holger Vogt 3632a6b4ae We need to translate from degree to rad 2023-03-18 22:32:25 +01:00
Holger Vogt 2a6052517b Fix prvious commit: allow access to all vector elements of cc 2023-03-18 22:32:19 +01:00
Holger Vogt 68156fa62c Complex number handling other than MSVC 2023-03-18 22:32:07 +01:00
Holger Vogt 71571a1432 Add function atanh to .control section 2023-03-18 22:31:48 +01:00
dwarning 45e6d319f3 partly revert last commit: only real input vector get special scaling for dc component 2023-03-18 14:31:31 +01:00
dwarning bccaee4821 correct fft dc scaling bug #620 2023-03-18 14:31:24 +01:00
Holger Vogt 02789b2c42 The modulo function a % n should accept a==0.
The fix adds this to the control section function parser. The numparam
parser already has this feature. n==0 is rejected as usual.
2023-01-15 13:37:57 +01:00
Holger Vogt 638a09b718 Make doxygen documentation complete as an example. 2022-10-22 19:51:32 +02:00
Holger Vogt 70f38ec25f Update for doxygen: add function names to \brief 2022-10-22 19:51:06 +02:00
Holger Vogt b6d2a50e42 Update to comments for doxygen 2022-10-22 19:50:40 +02:00
Holger Vogt 3288d5ac99 Test for doxygen documentation 2022-10-22 19:48:12 +02:00
Holger Vogt d7485d7136 Fix typo 2022-10-14 13:51:16 +02:00
Holger Vogt d46b4030fb Avoid jump in phase when crossing 90° boundaries.
Code similar to cx_cph in cmath1.c
2022-10-07 13:00:02 +02:00
Holger Vogt 26c50de68b function deriv: This is just a preliminary fix: prevent a crash
when base > 0.

But when is base supposed to be > 0 ? More invetigation is needed.
2022-04-25 21:34:41 +02:00
Holger Vogt 1605d293d0 Add function integ to control language
Trapezoidal rule for integrating a vector.
2021-12-13 21:49:45 +01:00
Carsten Schoenert 2c2e21a80c Smal typo fixup s/currntly/currently 2021-08-08 11:56:30 +02:00
Holger Vogt 4dbd8b7f9a Preliminary fix for the 'interpolate' function.
Interpolation of 1D vectors is o.k. now,
multi-dimensional vectors are not (yet) supported.
2021-07-22 20:37:57 +02:00
Holger Vogt 1698004078 The tests of cmaths function will be done only on request,
with configure flag --enable-cmathtests
2020-10-10 12:09:52 +02:00
Jim Monte b518d90509 EXITPOINT to delete malloced var in case of check failure 2020-04-27 10:16:37 +02:00
Holger Vogt 3a6a445241 rcheck -> rcheckn in cmath1.c
delete alloced memory in case of check failure
2020-04-04 14:11:32 +02:00
Holger Vogt ba81e21197 rcheckn: rcheck plus freeing allocated memory 2020-04-04 14:11:07 +02:00
Jim Monte de4788cfe5 Added conjugate function conj(). 2020-03-15 08:50:55 +01:00
Jim Monte ea81da2b01 [PATCH #55-1] Fixed some compiler warnings added by Visual Studio 2019 2019-08-13 23:29:13 +02:00
dwarning 76c43ab512 using the native tan and tanh math functions for real vector calculation 2018-10-13 18:18:47 +02:00
Holger Vogt 2786fcb86e New .option seed=[val|random] 2018-07-22 15:11:44 +02:00
Holger Vogt 09c876550f prevent string overflow by adding the string length
to the cp_getvar parameters. Used only with CP_STRING
2018-07-22 14:57:49 +02:00
Holger Vogt a98d01e5f8 Use only internal memory functions, replace
free->tfree, malloc->tmalloc, realloc->trealloc
2018-07-21 23:54:43 +02:00
dwarning b8a9ca9df4 correct the fft scaling for real input and complex output vector 2017-08-16 21:35:41 +02:00
rlar 3a9ace82bb winmain.c, etc, cleanup, rewrite obfuscated symbols
substitute in the whole source code:

  "__stream"       -->    "stream"
  "__pos"          -->    "pos"
  "__s"            -->    "s"
  "__n"            -->    "n"
  "__c"            -->    "c"
  "__format"       -->    "format"
  "__ptr"          -->    "ptr"
  "__size"         -->    "size"
  "__path"         -->    "path"
  "__mode"         -->    "mode"
  "__offset"       -->    "offset"
  "__whence"       -->    "whence"
  "__arglist"      -->    "arglist"
  "__buf"          -->    "buf"
  "__fp"           -->    "fp"

  "f_c_l_o_s_e"    -->    "win_x_fclose"
  "f_e_o_f"        -->    "win_x_feof"
  "f_e_r_r_o_r"    -->    "win_x_ferror"
  "f_f_l_u_s_h"    -->    "win_x_fflush"
  "fg_e_t_c"       -->    "win_x_fgetc"
  "f_g_e_t_p_o_s"  -->    "win_x_fgetpos"
  "fg_e_t_s"       -->    "win_x_fgets"
  "fp_r_i_n_t_f"   -->    "win_x_fprintf"
  "fp_u_t_c"       -->    "win_x_fputc"
  "fp_u_t_char"    -->    "win_x_fputchar"
  "fp_u_t_s"       -->    "win_x_fputs"
  "f_r_e_a_d"      -->    "win_x_fread"
  "f_r_e_o_p_e_n"  -->    "win_x_freopen"
  "fs_c_a_n_f"     -->    "win_x_fscanf"
  "f_s_e_e_k"      -->    "win_x_fseek"
  "f_s_e_t_p_o_s"  -->    "win_x_fsetpos"
  "f_t_e_l_l"      -->    "win_x_ftell"
  "f_w_r_i_t_e"    -->    "win_x_fwrite"
  "g_e_t_c"        -->    "win_x_getc"
  "g_e_t_char"     -->    "win_x_getchar"
  "g_e_t_s"        -->    "win_x_gets"
  "p_e_r_r_o_r"    -->    "win_x_perror"
  "p_r_i_n_t_f"    -->    "win_x_printf"
  "p_u_t_c"        -->    "win_x_putc"
  "p_u_t_char"     -->    "win_x_putchar"
  "p_u_t_s"        -->    "win_x_puts"
  "r_e_a_d"        -->    "win_x_read"
  "s_c_a_n_f"      -->    "win_x_scanf"
  "ung_e_t_c"      -->    "win_x_ungetc"
  "vfp_r_i_n_t_f"  -->    "win_x_vfprintf"
  "vfs_c_a_n_f"    -->    "win_x_vfscanf"
  "vp_r_i_n_t_f"   -->    "win_x_vprintf"
  "vs_c_a_n_f"     -->    "win_x_vscanf"
2017-02-10 19:50:42 +01:00
rlar ea5ad6b0e7 drop DC_ABS() and FTEcabs() 2016-10-15 15:06:18 +02:00
h_vogt ae80067fef cmath2.c, new function stddev to calculate the standard deviation of all elements of a vector 2016-10-15 15:06:17 +02:00
h_vogt 594db31ebc cmath2.c, whitespace cleanup 2016-10-15 15:06:17 +02:00
rlar b8b6677b85 cmath2.c, drop some excess NG_IGNORE() 2016-10-15 15:06:17 +02:00