- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I.m playing with a self-made FIR filter (no fir compiler used). I have read the theory, but the devil is in the implementation, as they say :-P my ADC generates 8 bits values [0-255]. can I just feed these into the filter or do I need to "center the signal around 0", i.e. make sure that the signal value on average is 0 for the calculations to work ? (this would require signed values...) second question, assuming I need signed values: is this correct ? reg [7:0] unsignedval; reg signed [7:0] signedval; // from unsigned to signed signedval <= $signed(unsignedval - 8'd128); // and back : unsignedval <= $unsigned(signedval + 8'sd127 + 8'sd1); (since 8'sd128 does not fit in 8 bits 2scomplement) thanks for getting me up to speed ! ps I built my own filter in order to avoid the added complexity and choice offered by the FIR compiler.Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
most DSP is done in 2's compliment, i would convert the ADC and DAC. that said i think it could be done in BCD, you won't find much reference material
building a FIR by hand is a great learning experience and handy for when you run into something that the off the shelf IP does not support, but i had trouble meeting (let alone beating) FIR Compiler II's fmax and resource usage. and when the specs changed it took seconds to redo the filter instead of going back and analyzing which coefficients to put in fabric, etc- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
regarding your conversions i'm not sure if you have to typecast the unsigned value before subtracting 128, i would run a sim as a sanity check. the general idea looks right
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you ! I seem to have it working (except for a strange glitch now and then..)

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page