Post Go back to editing

How to determine which frequency band has highest magnitude

Hi all.

I'm using ADAU1701 and SigmaStudio 3.10 beta.

I want to design a Index Selectable Filter to cut off the audio feedback from  different sources, eg: microphone, hoots and howls,  Different sources of feedback might contains different frequency and cause terrible sound overall.

I need to know the exact feedback frequency at that time, then only i can give the correct index to ISF to select which filter to apply.

The problem is how can i know from the signal at a time, which frequency has the highest magnitude?

For your info, the ISF (Index Seletcable Filter) accept only logic integer (0,1,2,3,4......)

I tried to read a few frequencies using General (2nd order) Filter and output linked into Envelope Peak.  Then, I compare all frequencies output to a Baisc DSP> Max, but this component 'Max" only compare and output the highest peak analog audio signal; not a valid input for ISF. 

 

Thanks in advance.

JCB

  •      Hello JCB,

         Likely you know that the best way to analyze the signal for frequency peaks is via FFT, which unfortunately the ADAU1701 cannot perform.  On the other hand, the ADAU1452 can do FFT.  Once out of curiosity I removed the cover of a stereo feedback-sensing EQ and found two Sharcs and a Blackfin.  Thus you have quite an ambitious project to run on a -1701, but even this basic SigmaDSP  still amazes me.  So, might as well give it a go.

         Below shows one way to find the loudest channel and output its number for your index filter.  The multiplexer continuously steps through all the channel levels.  When its output equals the max block's output, that must be the strongest channel -- which triggers comparator ABCD 2 to pulse the Value Hold block, locking its output to that channel's index.  The result is an integer from 0 to N-1, where N is the number of filters.  This can drive your index filter.

         Best regards,

         Bob

  • Thanks Bob for looking into this thread.

    I'd tried your suggestion in project named 'feedbackCancellation3.dsproj' as in attachment.

    But the readback always return '0'. Nothing more than 0 even if a feedback is generated purposely.  What could be the cause?

    Note: Anyway, attachment 'feebackCancellation2.dsproj' is my original project, which the ISF index was given by incorrect design, i guess. And thus, the output sound would filter down the entire song at different frequency randomly even though there is not exist any acoustic feedback.

    Thanks in advance.

    Best regards,

    JCB

    attachments.zip
  •      Hello JCB,

         It looks like I had forgotten an important detail -- the envelope peaks are always changing, and thus a peak capture would no longer be there by the time the mux cycled around to catch it.  Thus no matches, and the latched output stays put (I had tested the concept with manually changed DC sources).  Sorry about that.

         The attached project uses slowly changing oscillators to simulate the varying levels at each channel.  Now I strobe them all with the clock reset pulse, thus the roving comparison is static for each measurement cycle and the output does change as expected.  The remaining problem is during silence (switch off all the oscillators) -- then the output switches around some, even to an occasional out-of-bounds number (like "6").  To fix this likely you could make one of your channels a low-value DC source to act as a threshold, below which feedback zapping would never be needed.  Make the corresponding filter flat, of course.

         I'll test and comment on the projects you attached soon.

         Bob

    Max-finder.dspproj.zip
  • Thanks for your guidance.

    I had tried it in project 'feedbackCancellation4.dsproj'.

    Yet, I have no luck to get the appropriate index from multiplexer and Pulse Counter. 

    I test using WMP playing a recorded message and another VLC player playing 1kHz tone(feedback noise). 

    The index given by Pulse Counter seems not really return the highest peak channel.

    Any help is highly appreciated. Thank you.

    attachments.zip
  •      Hello JCB,

         No worries, we both need patience to get something as involved as this to work.  BTW -- have you seen this post:

    http://ez.analog.com/message/139844#139844

    which describes an alternative feedback prevention method.  If you try it -- a little pitch shift goes a long way in this application, and you need to increase the default Delay Reserved or else it will sound terrible.

         I attached a revised version of feedbackCancellation4 with several changes:

      • The detection filters were Parametric with zero boost -- essentially they were not filtering at all.  Peaking filters provide the needed band selectivity.  Filters are set at fourth-octave intervals.
      • Moving the out-of-bounds prevention to the source (the clock) makes both the index mux and the index filter operate properly.
      • I simplified the logic a bit by combining the thresholds with the frequency detections.  Likely you'll need to perfect the logic to mitigate any feedback as transparently as possible.

         When reducing the thresholds you'll definitely see the filters change, showing that the peak frequencies are being found.

         Best regards,

         Bob

    feedbackCancellation4b.dspproj.zip
  • Bob, Thank you. Really thank you so much.

    Your design is much more effective and ingenious.

    The horrible feedback sound was suppressed down more now.

    Again, thank you  so much.

    Best Regards,

    JCB

  • Hi Bob,

    I converted your project to ADAU1452 , but I can't make it work.

    Do you have a clue where the fault could be ?

    ADAU1452_FeedBackKiller4b.dspproj.zip
  •      Hello,

         Perhaps making these changes would help:

         The filter bank presently consists of parametric EQs with boost set to zero -- essentially not filtering at all.  Set them instead to peaking filters with a Q of about four.  This provides the selectivity needed to pick out the feedback frequency.

         The two times-4 gains shown below, which were needed because the ADAU1701 truncates the four LSBs of its readback, are not needed with the ADAU1452.  Thus you can remove them:

         Best regards,

         Bob

  • This is great work!  I have a similar application and I'm interested in learning more about the FFT on the ADAU1452.  I've found the FFT block in the Block schematic tab but I'm not sure how I can get a frequency readout from it.

    Thanks!