'프로그램 사용/fft, fftw'에 해당되는 글 38건

  1. 2023.03.30 libfftw3 precision
  2. 2023.03.29 spectrogram
  3. 2023.03.29 fft 분석 패러미터
  4. 2023.03.23 FFT 윈도우, 오버랩
  5. 2023.02.15 cabs()
  6. 2023.02.07 FFT 분석 기법
  7. 2022.11.16 fft window 함수
  8. 2022.11.16 fftw @ 22Hz sine파 대충 돌려보니
  9. 2022.11.04 real to complex
  10. 2022.11.04 fftw wisdom

libfftw3 만 있는 줄 알았는데 yocto에서 이상한(?) l d 이런 붙는게 있다고 해서 찾아보니

double / long / quad / single 이라는 이상한(?) 정밀도가 존재한다.

$ apt-cache search libfftw*
libfftw3-double3 - Fast Fourier Transforms 계산용 라이브러리 - 이중 정밀도
libfftw3-long3 - Library for computing Fast Fourier Transforms - Long precision
libfftw3-quad3 - Library for computing Fast Fourier Transforms - Quad precision
libfftw3-single3 - Library for computing Fast Fourier Transforms - Single precision
libfftw3-bin - Library for computing Fast Fourier Transforms - Tools
libfftw3-dbg - Library for computing Fast Fourier Transforms - debug symbols
libfftw3-dev - Library for computing Fast Fourier Transforms - development
libfftw3-doc - Documentation for fftw version 3
libfftw3-3 - Fast Fourier Transforms 계산용 라이브러리
libfftw3-mpi-dev - MPI Library for computing Fast Fourier Transforms - development
libfftw3-mpi3 - MPI Library for computing Fast Fourier Transforms
libgnuradio-fft3.7.11 - gnuradio fast Fourier transform functions
sndfile-tools - Collection of programs for operating on sound files

 

Link to the single/long-double libraries; on Unix, -lfftw3f or -lfftw3l instead of (or in addition to) -lfftw3. (You can link to the different-precision libraries simultaneously.)
Include the same <fftw3.h> header file.
Replace all lowercase instances of ‘fftw_’ with ‘fftwf_’ or ‘fftwl_’ for single or long-double precision, respectively. (fftw_complex becomes fftwf_complex, fftw_execute becomes fftwf_execute, etcetera.)
Uppercase names, i.e. names beginning with ‘FFTW_’, remain the same.
Replace double with float or long double for subroutine parameters.

[링크 : https://www.fftw.org/fftw3_doc/Precision.html]

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

partial fft  (0) 2023.04.04
fftw plan  (0) 2023.03.31
spectrogram  (0) 2023.03.29
fft 분석 패러미터  (0) 2023.03.29
FFT 윈도우, 오버랩  (0) 2023.03.23
Posted by 구차니

rtl-sdr에서 gqrx나 airspy sdr# 에서 처럼

주파수에 대한 그래프를 시간축으로 그리는 걸 spectrogram 이라고 하는 듯

 

[링크 : https://blog.freifunk.net/2017/06/26/choosing-spectrogram-visualization-library-javascript/]

[링크 : https://www.arc.id.au/Spectrogram.html]

 

에러 발생

[링크 : https://github.com/sebleier/spectrogram.js]

 

speccy - 오디오 초기화 문제 발생(linux google-chrome, firefox)

[링크 : https://github.com/drandrewthomas/Speccy]

 

+

정책 변경, deprecated로 인해서 먼가 손을 대긴 해야 할 듯

[링크 : https://sxbxn.tistory.com/12]

[링크 : https://developer.chrome.com/blog/autoplay/#webaudio]

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

fftw plan  (0) 2023.03.31
libfftw3 precision  (0) 2023.03.30
fft 분석 패러미터  (0) 2023.03.29
FFT 윈도우, 오버랩  (0) 2023.03.23
cabs()  (0) 2023.02.15
Posted by 구차니

FFT Size

FFT overlap

FFT windowing

 - leakage

[링크 : https://scribblinganything.tistory.com/532]

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

libfftw3 precision  (0) 2023.03.30
spectrogram  (0) 2023.03.29
FFT 윈도우, 오버랩  (0) 2023.03.23
cabs()  (0) 2023.02.15
FFT 분석 기법  (0) 2023.02.07
Posted by 구차니

Hamming 적용(끝부분으로 갈수록 0에 가깝게 억제) -> 손실 발생 -> 겹침(overlap) 적용 -> 손실 최소화

[링크 : https://m.blog.naver.com/ksunghwank/140119596852]

 

앞뒤에 0으로 된 신호가 있다고 간주하도록 신호의 앞 뒤를 0으로 눌러서 하면

유한시간 간격으로 좁힌다 라고 하는데 discrete 이기 때문인가?

[링크 : https://medialink.tistory.com/135]

 

특별한 이유가 없다면 Hanning 윈도우 적용하는 것이 좋다라..

Rectangluar는 가장 높은 주파수 분해능을 제공

Hamming, Hanning은 연속적인 파형 분석에 주로 사용됨

[링크 : https://m.blog.naver.com/lecroykorea/221549211257]

 

 

아무튼.. 요약하자면 입력받은 데이터를 그대로 때려박아도(rectangular) 상관없지만

분석 유형에 따라 Hanning등을 적용하는 것이 더 나을 수도 있다. 정도인가?

 

+

오버랩 블록의 몇 %를 다음 블록에서 다시 사용

그렇다면 전체 분석되는 주파수 범위가 늘어날 것 같은데, 시간 해상도를 높이는데 사용된다고 한다.

어떻게 보면.. Moving average 처럼 주파수를 옆으로 shift 해가면서 분석되서 나오는 주파수도 넓히고

새로운 주파수가 아닌 과거 주파수를 포함하긴 하지만 더 짧은 시간 주기로 결과를 낼 수 있는

반대로 생각하면 연산량에 더 많아지는 결과를 얻을 수 있게 될 듯?

[링크 : https://m.blog.naver.com/suya309/221467948212]

 

 

+

2023.03.30

[링크 : https://sanghyu.tistory.com/38]

[링크 : https://paeton.tistory.com/entry/Window-Function을-쓰는-이유

 

[링크 : https://dsp.stackexchange.com/questions/13856/filter-size-vs-fft-size-and-overlap-add]

[링크 : https://commons.wikimedia.org/wiki/File:FFT_size_vs_filter_length_for_Overlap-add_convolution.svg]

[링크 : https://dsp.stackexchange.com/questions/47448/window-periodoverlap-and-fft]

 

[링크 : https://www.katjaas.nl/FFTwindow/FFTwindow.html]

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

spectrogram  (0) 2023.03.29
fft 분석 패러미터  (0) 2023.03.29
cabs()  (0) 2023.02.15
FFT 분석 기법  (0) 2023.02.07
fft window 함수  (0) 2022.11.16
Posted by 구차니

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 구차니

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

FFT 윈도우, 오버랩  (0) 2023.03.23
cabs()  (0) 2023.02.15
fft window 함수  (0) 2022.11.16
fftw @ 22Hz sine파 대충 돌려보니  (0) 2022.11.16
real to complex  (0) 2022.11.04
Posted by 구차니

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

cabs()  (0) 2023.02.15
FFT 분석 기법  (0) 2023.02.07
fftw @ 22Hz sine파 대충 돌려보니  (0) 2022.11.16
real to complex  (0) 2022.11.04
fftw wisdom  (0) 2022.11.04
Posted by 구차니

요건.. sin() 함수를 이용해서 만든 입력 신호(원본)

대충.. 22.5Hz 되는 것 같은데..

 

fftw 결과의 첫번째 값.. 이게 허수부인지 실수부인지 모르겠다

a+bi 식이니 a 쪽이라 실수부 라고 봐야 할 것 같긴한데..

 

앞 부분만 잘라서 보니 대충.. 22 근처에 피크 하나 발생

 

요건.. 아마도 허수부

 

실수부와는 반대 형태로 발생

 

sqrt(a^2 + b^2) 로 계산해보니

 

23 앞뒤로 샤프하게 주파수 하나 발생한게 보이긴 한데..

 

이걸 10*log(n) 으로 줘보니.. 40dB 라고 보면 되려나? 단위가 어떻게 되는지 감이 안온다.

 

부분만 보면.. 23 근처에 peak로 뜨긴 한데..

 

16000sampling/sec 를 기준으로 데이터를 생성한거라..

결과로 나오는 8khz 대역중 22hz 하나에 peak로 뜨는건.. 너무 무리하게 sharp한 결과를 바라는것 같고..

아니면 window 크기를 조절해서 더 샤프하게 분석이 가능한가 궁금하기도 하네.

 

https://stackoverflow.com/questions/4675457/how-to-generate-the-audio-spectrum-using-fft-in-c#comment5156988_4675457

+

The data is an array of type fftw_complex, which is by default a double[2] composed of the real (in[i][0]) and imaginary (in[i][1]) parts of a complex number.

[링크 : https://www.fftw.org/fftw3_doc/Complex-One_002dDimensional-DFTs.html]

 

 복소수(複素數, 영어: complex number)는 {\displaystyle a+bi}a+bi ({\displaystyle a,b}a,b는 실수) 꼴의 수이다.

[링크 : https://ko.wikipedia.org/wiki/복소수]

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

FFT 분석 기법  (0) 2023.02.07
fft window 함수  (0) 2022.11.16
real to complex  (0) 2022.11.04
fftw wisdom  (0) 2022.11.04
FFT  (0) 2022.10.24
Posted by 구차니

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

fft window 함수  (0) 2022.11.16
fftw @ 22Hz sine파 대충 돌려보니  (0) 2022.11.16
fftw wisdom  (0) 2022.11.04
FFT  (0) 2022.10.24
fftw 예제 와 복소수 처리  (0) 2022.10.19
Posted by 구차니

fftw는 plan을 세우고 계산하는데, plan을  export 하고 import 할 수 있다고 한다.

그러면 초기 구동 속도를 더 올릴수 있으려나?

Importing and Exporting Wisdom


void fftw_export_wisdom_to_file(FILE *output_file);
fftw_status fftw_import_wisdom_from_file(FILE *input_file);

[링크 : https://www.fftw.org/fftw2_doc/fftw_2.html#SEC13]

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

fftw @ 22Hz sine파 대충 돌려보니  (0) 2022.11.16
real to complex  (0) 2022.11.04
FFT  (0) 2022.10.24
fftw 예제 와 복소수 처리  (0) 2022.10.19
fftw 테스트(tests/bench)  (0) 2022.10.19
Posted by 구차니