Skip to content

Commit

Permalink
ifft
Browse files Browse the repository at this point in the history
  • Loading branch information
Martmists-GH committed Dec 28, 2024
1 parent 32dce24 commit 8368886
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {
}

dependencies {
implementation("com.martmists.ndarray-simd:ndarray-simd:1.3.0")
implementation("com.martmists.ndarray-simd:ndarray-simd:1.3.1")
}
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {
}

group = "com.martmists.ndarray-simd"
version = "1.3.0"
version = "1.3.1"
val isProduction = (findProperty("production") ?: System.getProperty("production")) != null

repositories {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.martmists.ndarray.simd

import com.martmists.ndarray.simd.impl.create
import com.martmists.ndarray.simd.impl.unsupported

/**
* A 2D specialization type for [F64Array].
Expand Down Expand Up @@ -390,6 +389,23 @@ interface F64TwoAxisArray : F64Array {
*/
fun fftC2CInPlace()

/**
* Performs an inverse Complex-to-Complex FFT on this array in-place.
* The second axis has to be [real, imag].
* The resulting array is not normalized.
*
* @since 1.3.1
*/
fun ifftC2CInPlace() {
// Conjugate
V[_I, 1] = -V[_I, 1]

fftC2CInPlace()

// Conjugate again
V[_I, 1] = -V[_I, 1]
}

/**
* Performs a Complex-to-Complex FFT on this array.
* The second axis has to be [real, imag].
Expand All @@ -400,6 +416,16 @@ interface F64TwoAxisArray : F64Array {
*/
fun fftC2C() = copy().apply { fftC2CInPlace() }

/**
* Performs an inverse Complex-to-Complex FFT on this array.
* The second axis has to be [real, imag].
* The resulting array is not normalized.
*
* @return the IFFT result
* @since 1.3.1
*/
fun ifftC2C() = copy().apply { ifftC2CInPlace() }

companion object {
/**
* Creates a [F64TwoAxisArray] from a [DoubleArray].
Expand Down

0 comments on commit 8368886

Please sign in to comment.