Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Filter output is noisy HELP FDAtool of Matlab.

Status
Not open for further replies.

Ignorius

Newbie level 3
Joined
May 19, 2010
Messages
4
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,326
Hello guys,
I have been working on a project for a while and now stuck on a problem that annoys me. I am trying to fillter a wav file through a Low-Pass FIR filter on FPGA. When I send 8-bit samples to the FPGA it returns noisy output.

I have a receiver gets the 8-bit sample and passes it to the filter,
Filter then processes the sample and gives a 8-bit output to the transmitter.
Transmitter sends it to the PC in serial. You can see system in below figure.
**broken link removed**

I generated VHDL code of low pass filter with FDATool of MatLab with following spesifications.
Low-Pass - Equiripple (Direct Form I)
F sample: 44100Hz
F pass : 3500
Fstop : 4500
Order: 6
Filter Arithmetic: Fixed-point
Filter Precision: Specify all

Coefficients->
Numerator Word Length : 8
best precision fraction lengths: checked
use unsigned representation: cleared
scale the numerator coefficients...: cleared

Input/Output->
Input word length : 8
Input Fraction Length: 7
Output word Length: 8
Output Fraction length: 7

Filter Internals->
Product word length: 16
Product fraction length: 15
Accum word length : 18
Accum fraction length :15

Rounding mode: Nearest(convergent)
Overflow mode: Saturate

VHDL generation options are shown in figure
**broken link removed**

Wav file is sampled at 44100 khz and looks like
**broken link removed**

And the output wav file looks like this
**broken link removed**

When I zoom into both the first wav file and the filtered wav file, i see jumps and broken points in the wav file. as you can see below.
This one is wav file not filtered (zoomed in).
**broken link removed**

This one is filtered wav file (same zoomed as input).
**broken link removed**

This one is filtered wav file (with more zoom).
**broken link removed**

This one is filtered wav file (with much more zoom).
**broken link removed**
you can see sample points in this figure.

I will attach the wav file and the filtered one in audio.zip file.

I think i am doing something wrong about filter design but i could not find the actual problem. I tried, lots of variations with the given sipesifications.I hope this is a small mistake and can be solved easily. I would be gratefull for any answers. Please think about this problem and return me an idea.

Thanks
 

I think, you got integer overflow inside filter. Check that signal's amplitude and frequency are in valid range. Decrease amplitude.
Try to analyze filter output as integer numbers (not dB representation)
 

alexadmin said:
I think, you got integer overflow inside filter. Check that signal's amplitude and frequency are in valid range. Decrease amplitude.
Try to analyze filter output as integer numbers (not dB representation)

*Thank you alexadmin, i thought overflow inside the filter too. Signal samples are 8-bit and i think samples are stored as unsigned between "0000000"-"11111111" (0-255) as (+-1 range) but i am not sure. :roll:

*I selected sampling frequency (Fs) in FDATool same as sample frequency of wav file. (44100Hz)

*Ill analyse input and output as integer values and post the images a few hours later when I arrive home. Can you suggest any free software capable of analysing wav file samples as integer values and decreasing the amplitude of the samples?

*Can anyone suggest any option for FDAtool for my filter in the system as I introduced 8-bit unsigned input 8-bit unsigned output?

*And I am still open for any ideas to solve this problem guys.
Thanks. :)
 

I have decreased amplitude by dividing 2-4-8-16 and filtered this way. Each one has got the same noise from filter and same amplitude.

So it is clearly not about the amplitude of the input.

Actually i created a (zeros) sound file and passed it through the system. It did not got noise on it. I came as (zeros) sound file back.

Any ideas???

I just need a simple VHDL code LOW-PASS filter to tyr in my project, which has 8-bit input data length and 8-bit output data length. 2-3 KHz cutoff frequency with any sample rate available.

If anyone could help me who use ONEoverT software, or any other VHDL generator software, I would be grateful.
 

The following is relevant:
1.) make sure the design meets timing. (if these are actual outputs, not sim outputs). Failing this, you will never get good results, even with perfect RTL.
2.) make a testbench for the filter. the input to the filter will be one-sample impulses of increasing amplitude. The output (for FIR filters) should be the filter coefficients. for IIR, it will be the impulse response of the filter (but may not be correct for low signal levels. It may also show limit-cycles. IIR filters have interesting numeric issues depending on the implementation.)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top