Implement fixed-point Fast Fourier Transform#207
Implement fixed-point Fast Fourier Transform#207ethanuppal wants to merge 4 commits intointel:mainfrom
Conversation
Signed-off-by: Ethan Uppal <113849268+ethanuppal@users.noreply.github.com>
Signed-off-by: Ethan Uppal <113849268+ethanuppal@users.noreply.github.com>
Signed-off-by: Ethan Uppal <113849268+ethanuppal@users.noreply.github.com>
Signed-off-by: Ethan Uppal <113849268+ethanuppal@users.noreply.github.com>
| @@ -0,0 +1,225 @@ | |||
| // Copyright (C) 2021-2024 Intel Corporation | |||
There was a problem hiding this comment.
Try to keep the headers consistent and accurate:
- Make sure you update copyright years
- Most files should have some header describing what the file is, and you can put your name as the author for files you create if you wish
See other files or CONTRIBUTING.md for examples
There was a problem hiding this comment.
When you add new components/files that should be publicly visible, make sure to export them (e.g. see lib/src/arithmetic/signals/signals.dart, or the appropriate one per-file)
| } | ||
|
|
||
| Logic _realPart() => | ||
| getRange(0, _fixedPointWidth(signed, integerBits, fractionalBits)); |
There was a problem hiding this comment.
Conceptually, the getRange function creates a new module which extracts the requested bits from the original signal and produces an output that results from that operation. Assigning to that output (as you did in some functions above) doesn't make sense and you'll (hopefully) get an error or at least X.
I think a more convenient way to structure a grouping of two FixedPoints would be to create a LogicStructure which contains two FixedPoints as elements. Then they can be individually referenced, assigned, etc. without needing to extract bits each time or manage widths yourself.
| class ComplexFixedPoint extends Logic { | ||
| final bool signed; | ||
|
|
||
| final int integerBits; |
There was a problem hiding this comment.
for consistency (including with #208), better might be to call *Width
|
|
||
| // mux(this[-1], mux(other[-1], ), mux()) | ||
|
|
||
| FixedPoint.of(sum, signed: signed, m: m + 1, n: n); |
| import 'package:rohd/rohd.dart'; | ||
| import 'package:rohd_hcl/rohd_hcl.dart'; | ||
|
|
||
| @immutable |
There was a problem hiding this comment.
i think you'll want to implement == and hashCode as well
| import 'package:rohd/rohd.dart'; | ||
| import 'package:rohd_hcl/rohd_hcl.dart'; | ||
|
|
||
| int bitReverse(int value, int bits) { |
There was a problem hiding this comment.
you could make this private (_bitReverse) if this isn't something we want to expose in the library. Alternatively, you could use LogicValue's reversed to do the work (which also then would cover values >64 bits as well)
|
Closing in favor of a fully-pipelined floating-point implementation (#210). |
Description & Motivation
I made this at the start of my Intel internship to learn about ROHD components. I have been polishing it up afterward to turn it into a PR.
I added:
LogicArraysRelated Issue(s)
Testing
Backwards-compatibility
Documentation