cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
1,112 Views
Registered: ‎10-17-2019

Lowpass Audio Filter

Hi,

I am trying to establish a lowpass filter to Audio Demo code of Nexys A7 board. I have implemented a filter however i hear just a noise. If you share your time, i will be happy. I have added the project which was generated by Vivado 2018.2.

Vivado Project 

Best regards.

0 Kudos
14 Replies
Highlighted
Teacher
Teacher
1,105 Views
Registered: ‎07-09-2009

Re: Lowpass Audio Filter

That could be 1001 problems, from wrong code, wrong wiring to wrong algorithm,

So no way to answer that,

Whats your experience of FPGAs, what level of support and test equipment do have ?

First up, the code,
what tools you using to code ?
whats the test bench loo like ?
what constraints do you have ?
does it compile without errors , and are all warnings understood ?

Answer this and we can help,

If you do post code, do it as an attachment please

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
Highlighted
Explorer
Explorer
1,095 Views
Registered: ‎04-19-2018

Re: Lowpass Audio Filter

 

"you just hear a noise" so you attach your project waiting for a solution. Good. I love that energy.

I'd suggest not to hear things but see.

Make a test bench, create a signal that help you testing it, a chirp or a mix of frequencies, run the simulation and analyze the output, you can plot results as analogue, so you can observe sine waves.

0 Kudos
Highlighted
Visitor
Visitor
1,086 Views
Registered: ‎10-17-2019

Re: Lowpass Audio Filter

Thank you so much. Because of the size of file i could not upload it. I am a beginner for FPGA. I have implemented it without error. Can you check the drive link? 

0 Kudos
Highlighted
Teacher
Teacher
1,069 Views
Registered: ‎07-09-2009

Re: Lowpass Audio Filter

Can you reply to the rest of the questions I asked and we might be able to give a little more help

Also , 

can you post as an attatchment just the test bench your using

and

drop back to the default audio project,  does that work ?

 

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
Highlighted
Explorer
Explorer
1,069 Views
Registered: ‎04-19-2018

Re: Lowpass Audio Filter

 

I´m thinking of uploading here every morning what I have to do at work and go drinking coffee all day. 

Highlighted
Scholar
Scholar
1,008 Views
Registered: ‎05-21-2015

Re: Lowpass Audio Filter

@satguy,

All snark aside, thank you for bringing a smile to my day!

@redaccen,

Since I'm not sure @satguy made his point clearly, let me try to spell it out: Getting something to work on an FPGA is hard work.  If you do it well, the hard part is over by the time you get to the FPGA.  Doing it well requires simulation.  It requires anticipating *everything* that might go wrong in your simulation.  It requires comparing your designs output to a model of what the output should look like, perhaps using Matlab or (my favorite) Octave.  This takes work.  Hard work.  By the time you are done, you should have the trace of a waveform in hand of what you expect to happen on the FPGA.

Good form is when things work perfectly, for the first time, the moment they hit the FPGA.

I haven't hit this nirvana yet myself.  As a result, I find myself debugging things from within the FPGA--and learning what I should've done better every time.  While that's doable, it's much harder to do.  (Emphasis on M*U*C*H HARDER!)  Indeed, it's so hard that I would discourage you from it if at all you can avoid it via either simulation or (my favorite) formal verification.

I look forward to seeing your test bench work,

Dan

0 Kudos
Highlighted
Visitor
Visitor
889 Views
Registered: ‎10-17-2019

Re: Lowpass Audio Filter

Thank you so much @drjohnsmith 

I could not write a test bench because i am working with audio signals. However, i have verified my convolution individually, i am sending convolution's source code and testbench. I have prepare project on Vivado 2018.2 and just used Nexys A7 board and a simple headset to listen output. It compiled without any error. 

When i tried to implement it to AudioDemo which was generated by here https://github.com/Digilent/Nexys-A7-100T-OOB?files=1 there is a significant noise. I have just edited AudioDemo.vhd for implementing convolution filter. I was tried to use chipscope and added to attachment.

There was a critical error as;

"[Timing 38-469] The REFCLK pin of IDELAYCTRL Inst_Audio/DDR/Inst_DDR/u_ddr_mig/u_iodelay_ctrl/u_idelayctrl_200 has a clock period of 5.053 ns (frequency 197.917 Mhz) but IDELAYE2 Inst_Audio/DDR/Inst_DDR/u_ddr_mig/u_memc_ui_top_std/mem_intfc0/ddr_phy_top0/u_ddr_mc_phy_wrapper/u_ddr_mc_phy/ddr_phy_4lanes_0.u_ddr_phy_4lanes/ddr_byte_lane_A.ddr_byte_lane_A/ddr_byte_group_io/input_[1].iserdes_dq_.idelay_dq.idelaye2 has REFCLK_FREQUENCY of 200.000 Mhz (period 5.000 ns). The IDELAYCTRL REFCLK pin frequency must match the IDELAYE2 REFCLK_FREQUENCY property."

I also get filter parameters from MATLAB Filter Designer Tool, there is also an analog LPF on Nexys A7 board about 10kHz, and my filter seems about 5kHz, however noıse did not decrease. When i turned back the default demo, it works correctly. I have mentioned constraint file and MATLAB filter designer result.

PS: When i upload the files, i have given an error related to spam and i have upload it again to drive link.

Best regards.

Chipshope.png
MATLAB.png
0 Kudos
Highlighted
Teacher
Teacher
870 Views
Registered: ‎07-09-2009

Re: Lowpass Audio Filter

Im surprised your asking @redaccen ,
You are obviously an expert,

multiple of us have talked to you as to how to approach any debugging, yet you are ignoring our suggestions,


<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Highlighted
Scholar
Scholar
846 Views
Registered: ‎05-21-2015

Re: Lowpass Audio Filter

@redaccen,

With the help of the others who have replied and the years of my own experience, I have managed to find the root cause of your problem.  It's not in your design itself--that's only the symptom, not the cause.  The cause is revealed instead by your comment above.

I could not write a test bench because i am working with audio signals..


This is why you cannot find the cause of the bug in your design.  The fact that you are working with audio signals should not prevent you from writing a test bench and simulating a design.  I simulate designs with audio signals all the time when working with audio.  It's slow.  It's painful.  But ... it works.

Why don't we start here, then.  What simulation tool are you using, and why are you struggling to build a test bench for audio signals?

Dan

Highlighted
Visitor
Visitor
832 Views
Registered: ‎10-17-2019

Re: Lowpass Audio Filter

@dgisselq 

Thank you Dan. I am using Vivado 2018.2. The reason is that i am taking digital data from microphone and i can not imagine to detect the analog signal from this signal. How can i simulate the analog signal or can i take any beneficial information from the desserialized data which come from the microphone or goes to the output?

0 Kudos
Highlighted
Scholar
Scholar
826 Views
Registered: ‎05-21-2015

Re: Lowpass Audio Filter

For all who might read here, I'd like to note that @redaccen has posted both on this forum and on Digilent's forums here.  In the other forum, D@n (that's me) recommended several steps that could be taken in both simulation and live hardware that would  be valuable.

@redaccen,

Thank you Dan. I am using Vivado 2018.2. The reason is that i am taking digital data from microphone and i can not imagine to detect the analog signal from this signal. How can i simulate the analog signal or can i take any beneficial information from the desserialized data which come from the microphone or goes to the output?


You pose a wonderful question here.  It's a good one, too!  This is probably where we should be placing the focus on this forum topic.

Were this one of my own projects, I would ...

  • Create a contrived input to the filter.  I like to use impulses first, but then also sinewave's for this purpose.  I'd then prove the filter in simulation using these contrived inputs.
  • Create a data capture design or other means of capturing the input from the microphone.  I'd then use a captured microphone input as the input to my simulation.  I'd verify the output of my simulation matches the output that I would expect as well.
  • There are two types of simulation that are important here: unit testing, and integrated testing.  You'll want to make certain you do both--since there are a lot of things that can still go wrong after you have a working filter in a unit test but not (yet) in an integrated full design test.

Perhaps this might help you get started,

Dan

 

Highlighted
Visitor
Visitor
818 Views
Registered: ‎10-17-2019

Re: Lowpass Audio Filter

@dgisselq  Points you have mentioned are really important for me. I will try to solve test bench issue using your recommendations. Best regards.

0 Kudos
Highlighted
814 Views
Registered: ‎06-21-2017

Re: Lowpass Audio Filter

There are many options.  If you have MatLab, you can make a text file to use as an input to a simulation.  You should also look at some Xilinx IP.  The DDS can make a pure sine wave.  You could use that for a simulation stimulus.  You could also use a DDS and tie it directly to the output of your FPGA and you should hear a pure tone.  If you don't, your problem is on the output side.  If you hear a tone, then put the filter in-line after the DDS.  Do you still hear a tone?  Have you looked at the Xilinx filter IP?  This will produce a more efficient filter than one you write yourself (unless you're really good).  You could also put an ILA on the deserialized microphone signal and feed the mike with a tone.  Do you collect a sinusoid here?  Still, I agree with @dgisselq , @drjohnsmith  and @satguy , simulate first.

Highlighted
Visitor
Visitor
809 Views
Registered: ‎10-17-2019

Re: Lowpass Audio Filter

@bruce_karaffa  I have used MATLAB for filter design but i will check it for simulation. For some filter coefficients, i hear just a low level voice but there is also a significant noise. I will search how to use Xilinx Filter IP. Best regards.

0 Kudos