PINE LIBRARY
Spectrum

Library "Spectrum"
This library includes spectrum analysis tools such as the Fast Fourier Transform (FFT).

method toComplex(data, polar)
Creates an array of complex type objects from a float type array.
Namespace types: array<float>
Parameters:
data (array<float>): The float type array of input data.
polar (bool): Initialization coordinates; the default is false (cartesian).
Returns: The complex type array of converted data.
method sAdd(data, value, end, start, step)
Performs scalar addition of a given float type array and a simple float value.
Namespace types: array<float>
Parameters:
data (array<float>): The float type array of input data.
value (float): The simple float type value to be added.
end (int): The last index of the input array (exclusive) on which the operation is performed.
start (int): The first index of the input array (inclusive) on which the operation is performed; the default value is 0.
step (int): The step by which the function iterates over the input data array between the specified boundaries; the default value is 1.
Returns: The modified input array.
method sMult(data, value, end, start, step)
Performs scalar multiplication of a given float type array and a simple float value.
Namespace types: array<float>
Parameters:
data (array<float>): The float type array of input data.
value (float): The simple float type value to be added.
end (int): The last index of the input array (exclusive) on which the operation is performed.
start (int): The first index of the input array (inclusive) on which the operation is performed; the default value is 0.
step (int): The step by which the function iterates over the input data array between the specified boundaries; the default value is 1.
Returns: The modified input array.
method eMult(data, data02, end, start, step)
Performs elementwise multiplication of two given complex type arrays.
Namespace types: array<cx.complex>
Parameters:
data (array<complex> type from RezzaHmt/Complex/1): the first complex type array of input data.
data02 (array<complex> type from RezzaHmt/Complex/1): The second complex type array of input data.
end (int): The last index of the input arrays (exclusive) on which the operation is performed.
start (int): The first index of the input arrays (inclusive) on which the operation is performed; the default value is 0.
step (int): The step by which the function iterates over the input data array between the specified boundaries; the default value is 1.
Returns: The modified first input array.
method eCon(data, end, start, step)
Performs elementwise conjugation on a given complex type array.
Namespace types: array<cx.complex>
Parameters:
data (array<complex> type from RezzaHmt/Complex/1): The complex type array of input data.
end (int): The last index of the input array (exclusive) on which the operation is performed.
start (int): The first index of the input array (inclusive) on which the operation is performed; the default value is 0.
step (int): The step by which the function iterates over the input data array between the specified boundaries; the default value is 1.
Returns: The modified input array.
method zeros(length)
Creates a complex type array of zeros.
Namespace types: series int, simple int, input int, const int
Parameters:
length (int): The size of array to be created.
method bitReverse(data)
Rearranges a complex type array based on the bit-reverse permutations of its size after zero-padding.
Namespace types: array<cx.complex>
Parameters:
data (array<complex> type from RezzaHmt/Complex/1): The complex type array of input data.
Returns: The modified input array.
method R2FFT(data, inverse)
Calculates Fourier Transform of a time series using Cooley-Tukey Radix-2 Decimation in Time FFT algorithm, wikipedia.org/wiki/Cooley–Tukey_FFT_algorithm.
Namespace types: array<cx.complex>
Parameters:
data (array<complex> type from RezzaHmt/Complex/1): The complex type array of input data.
inverse (int): Set to -1 for FFT and to 1 for iFFT.
Returns: The modified input array containing the FFT result.
method LBFFT(data, inverse)
Calculates Fourier Transform of a time series using Leo Bluestein's FFT algorithm, wikipedia.org/wiki/Chirp_Z-transform This function is nearly 4 times slower than the R2FFT function in practice.
Namespace types: array<cx.complex>
Parameters:
data (array<complex> type from RezzaHmt/Complex/1): The complex type array of input data.
inverse (int): Set to -1 for FFT and to 1 for iFFT.
Returns: The modified input array containing the FFT result.
method DFT(data, inverse)
This is the original DFT algorithm. It is not suggested to be used regularly.
Namespace types: array<cx.complex>
Parameters:
data (array<complex> type from RezzaHmt/Complex/1): The complex type array of input data.
inverse (int): Set to -1 for DFT and to 1 for iDFT.
Returns: The complex type array of DFT result.
This library includes spectrum analysis tools such as the Fast Fourier Transform (FFT).
method toComplex(data, polar)
Creates an array of complex type objects from a float type array.
Namespace types: array<float>
Parameters:
data (array<float>): The float type array of input data.
polar (bool): Initialization coordinates; the default is false (cartesian).
Returns: The complex type array of converted data.
method sAdd(data, value, end, start, step)
Performs scalar addition of a given float type array and a simple float value.
Namespace types: array<float>
Parameters:
data (array<float>): The float type array of input data.
value (float): The simple float type value to be added.
end (int): The last index of the input array (exclusive) on which the operation is performed.
start (int): The first index of the input array (inclusive) on which the operation is performed; the default value is 0.
step (int): The step by which the function iterates over the input data array between the specified boundaries; the default value is 1.
Returns: The modified input array.
method sMult(data, value, end, start, step)
Performs scalar multiplication of a given float type array and a simple float value.
Namespace types: array<float>
Parameters:
data (array<float>): The float type array of input data.
value (float): The simple float type value to be added.
end (int): The last index of the input array (exclusive) on which the operation is performed.
start (int): The first index of the input array (inclusive) on which the operation is performed; the default value is 0.
step (int): The step by which the function iterates over the input data array between the specified boundaries; the default value is 1.
Returns: The modified input array.
method eMult(data, data02, end, start, step)
Performs elementwise multiplication of two given complex type arrays.
Namespace types: array<cx.complex>
Parameters:
data (array<complex> type from RezzaHmt/Complex/1): the first complex type array of input data.
data02 (array<complex> type from RezzaHmt/Complex/1): The second complex type array of input data.
end (int): The last index of the input arrays (exclusive) on which the operation is performed.
start (int): The first index of the input arrays (inclusive) on which the operation is performed; the default value is 0.
step (int): The step by which the function iterates over the input data array between the specified boundaries; the default value is 1.
Returns: The modified first input array.
method eCon(data, end, start, step)
Performs elementwise conjugation on a given complex type array.
Namespace types: array<cx.complex>
Parameters:
data (array<complex> type from RezzaHmt/Complex/1): The complex type array of input data.
end (int): The last index of the input array (exclusive) on which the operation is performed.
start (int): The first index of the input array (inclusive) on which the operation is performed; the default value is 0.
step (int): The step by which the function iterates over the input data array between the specified boundaries; the default value is 1.
Returns: The modified input array.
method zeros(length)
Creates a complex type array of zeros.
Namespace types: series int, simple int, input int, const int
Parameters:
length (int): The size of array to be created.
method bitReverse(data)
Rearranges a complex type array based on the bit-reverse permutations of its size after zero-padding.
Namespace types: array<cx.complex>
Parameters:
data (array<complex> type from RezzaHmt/Complex/1): The complex type array of input data.
Returns: The modified input array.
method R2FFT(data, inverse)
Calculates Fourier Transform of a time series using Cooley-Tukey Radix-2 Decimation in Time FFT algorithm, wikipedia.org/wiki/Cooley–Tukey_FFT_algorithm.
Namespace types: array<cx.complex>
Parameters:
data (array<complex> type from RezzaHmt/Complex/1): The complex type array of input data.
inverse (int): Set to -1 for FFT and to 1 for iFFT.
Returns: The modified input array containing the FFT result.
method LBFFT(data, inverse)
Calculates Fourier Transform of a time series using Leo Bluestein's FFT algorithm, wikipedia.org/wiki/Chirp_Z-transform This function is nearly 4 times slower than the R2FFT function in practice.
Namespace types: array<cx.complex>
Parameters:
data (array<complex> type from RezzaHmt/Complex/1): The complex type array of input data.
inverse (int): Set to -1 for FFT and to 1 for iFFT.
Returns: The modified input array containing the FFT result.
method DFT(data, inverse)
This is the original DFT algorithm. It is not suggested to be used regularly.
Namespace types: array<cx.complex>
Parameters:
data (array<complex> type from RezzaHmt/Complex/1): The complex type array of input data.
inverse (int): Set to -1 for DFT and to 1 for iDFT.
Returns: The complex type array of DFT result.
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.