Forum Discussion
NCO help...
Hi i'm trying to test a fixed point filter on a FPGA board, my filter has an input of 16 bit, but the maximum value it can take without saturation is 1023 which is 11 bits. so far the only signal i've been using to is the NCO megafunction. when i set the NCO to have a magnitude of 16 bits i get severe distortion and loss of precision, i cant change the NCO to have a smaller number of bits or i get a bit mismatch, and i cant reduce the number of bits of the filter because i get distortion and loss of precision again. i'm using simulink and fixed point advisor in simulink to design this filter....
Can anyone please help..? not sure if there is another way to test the filter with a more dynamic signal. or if anyone is familiar with simulink how i can optimize my design.36 Replies
- Altera_Forum
Honored Contributor
--- Quote Start --- See below two simple methods to achieve what you want. There are more (including more elegant) methods described in the online help under using connectors. Try and have fun! --- Quote End --- Great! it finally works! but quick question..? so does it connect to the MSBs of the input port or the LSBs of the input port. - Altera_Forum
Honored Contributor
Okay i see...so what happens to the last bit on the 12 bit input?
- Altera_Forum
Honored Contributor
To further Clarify what i'm saying is, i have an NCO with a 11bit output. but the filter has a 12 bit input. under these conditions if i just simply draw a wire i will get a width mismatch. i tried to do this in VHDL like Kaz suggested but it wouldnt work. if it's easier to do it in the schematic i would prefer that way. i just want clear detailed instruction as i have never done this before and information online seems scarce.
- Altera_Forum
Honored Contributor
--- Quote Start --- The name of the component is exactly "wire". --- Quote End --- But the wire doesnt give me the option to do what you are describing. i feel like we're talking about two diffeerent things here. - Altera_Forum
Honored Contributor
The name of the component is exactly "wire".
- Altera_Forum
Honored Contributor
sorry i'm fairly new to quartus and i'm not familiar with doing this...so how exactly do this...or i should say what component do i use.
- Altera_Forum
Honored Contributor
Assuming both data are 2s complement (NCO output definitely is), just copy bit 10 to bit 11. You need to access individual bits for this. It's only a trivial schematic entry problem, not related to DSP or NCO anyhow. The standard library has e.g. a wire component to connect different nets.
- Altera_Forum
Honored Contributor
- Altera_Forum
Honored Contributor
If your NCO is swinging +/- 1023 on 11 bits then it will swing +/- 1023 on 16 bits provided you connect as described.
- Altera_Forum
Honored Contributor
Yes i do understand that, but not that brings up a good point...since the NCO is a sinosuid it'll have negative and positive values...how would i accomodate for that?