chatGPT에게 fftw의 complex (복소수)를 어떻게 진폭으로 바꾸냐고 물어보니 나온 함수

 

#include <complex.h>
double cabs(double complex z);
float cabsf(float complex z);
long double cabsl(long double complex z);

Link with -lm.

Description
The cabs() function returns the absolute value of the complex number z. The result is a real number.

Versions
These functions first appeared in glibc in version 2.1.

Conforming to
C99.

Notes
The function is actually an alias for hypot(a, b) (or, equivalently, sqrt(a*a + b*b)).

[링크 : https://linux.die.net/man/3/cabs]

 

그나저나 저 copmlex라는 변수 타입은 어디서 어떻게 정의 되어 있나?

C99 지원하는 컴파일러의 primitive인가?

 

ISO C99 supports complex floating data types, and as an extension GCC supports them in C90 mode and in C++. GCC also supports complex integer data types which are not part of ISO C99. You can declare complex types using the keyword _Complex. As an extension, the older GNU keyword __complex__ is also supported.

[링크 : http://./cortexa53-crypto-poky-linux/usr/src/debug/glibc/2.33-r0/git/include/complex.h]

'프로그램 사용 > fft, fftw' 카테고리의 다른 글

fft 분석 패러미터  (0) 2023.03.29
FFT 윈도우, 오버랩  (0) 2023.03.23
FFT 분석 기법  (0) 2023.02.07
fft window 함수  (0) 2022.11.16
fftw @ 22Hz sine파 대충 돌려보니  (0) 2022.11.16
Posted by 구차니