Skip to content

Commit a229bb2

Browse files
committed
Add convenience method for complex numbers for j.
1 parent d56a3ea commit a229bb2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/scala/dsptools/numbers/DspComplex.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ object DspComplex {
1717
result.imaginary := imaginary
1818
result
1919
}
20+
def j[T <: Data:Ring]() : DspComplex[T] =
21+
wire(Ring[T].zero, Ring[T].one)
2022
def multiplyByJ[T <: Data:Ring](x: DspComplex[T]): DspComplex[T] =
2123
wire(x.imaginary, -x.real)
2224
}

0 commit comments

Comments
 (0)