Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Impulse response - low freq accuracy
Avatar
Pajczur
Member
Members
February 13, 2018 - 5:30 am
Member Since: February 13, 2018
Forum Posts: 4
sp_UserOfflineSmall Offline

Hello,
I have question probably more in audio processing, than programming at all.
Just for fun, for understand little bit more I made my own plugin to measure impulse response of the filters. Something that allows me to see various equalisers curves. Similar like it happens in Waves QClone plugin - but qClone can also implement those curves to other signals, like regular EQ, but my plugin just measure those curves - as I know VST Plugin Analyser can do similar things.
But with my plugin the problem is accuracy of low frequences, somewhere below 150 Hz it starts to show crazy curves, inappropriate to real EQ changes. But above 150 Hz everything is OK (almost OK - it shows almost perfectly the EQ curves, but has problem to show curves for very narrow Q parameters).
And I was wondering almost whole week, what I do wrong, I tried to change resolution o measured frequencies range, also tried to change buffersize for one impulse. Don’t know what to do and it is annoying hardly :slight_smile: please help me.
My code for measure impulse response is mainly like that:

float freqResolution = 1000.0f;
// it’s for set range of measured freq:
float minFreqIndex = log10(20.0f)*freqResolution / log10(wSampleRate);
float maxFreqIndex = log10(20000.0f)*freqResolution / log10(wSampleRate);

for(int sample=(int)minFreqIndex; sample < maxFreqIndex; sample++) {
    
    logScaleFreq = pow(10.0f, log10(wSampleRate) * (float)sample / (freqResolution-1.0f));
    
    
    _Re = processor.filteredImpulse[0];
    _Im = 0.0f;
    
    
    for (int i=1; i<buffersize; ++i) {
        _Re += processor.filteredImpulse[i] * cosf(-(float)i * 2 * double_Pi * logScaleFreq / wSampleRate);
        _Im += processor.filteredImpulse[i] * sinf(-(float)i * 2 * double_Pi * logScaleFreq / wSampleRate);
    }
    
    float _Re_2 = pow(_Re, 2.0f);
    float _Im_2 = pow(_Im, 2.0f);
    float _Hf = pow(_Re_2 + _Im_2, 0.5f);

    logScale_dB = 20*log10(_Hf);

Mainly it’s something like that, and then I print it as a logScale_dB in the function of logScaleFreq.
For any help, great thanks in advance.

Of course

processor.filteredImpulse[i]

It’s an filtered data from array of one impulse, something like [1, 0, 0, 0, 0, 0, 0, 0, 0…]
with length dependent on buffersize. But there is always only one 1, and many of zeros, like I think impulse should be :slight_smile:

Avatar
W Pirkle
Admin
February 13, 2018 - 8:01 am
Member Since: January 28, 2017
Forum Posts: 391
sp_UserOfflineSmall Offline

Have you used the Impulse Response/Frequency Response in the analyzer in RackAFX? It uses the same idea and also takes impulse responses of filters, runs a FFT and shows the frequency response. It also show the step and phase responses.  

The frequency resolution for the FFT is poor at low frequencies. You will see the same thing when you use the Analyzer in RackAFX to plot the FR of a filter - at low cutoff frequencies the curves are incorrect. The frequency resolution of a FFT is N/fs where N = number of points in FFT. For 1024, this puts the first bin at about 43Hz and the second at about 86Hz.

The only solution (as you can prove with the Analyzer in RackAFX) is to increase the number of points in the FFT. Try it.

I also posted a video on this:

http://www.willpirkle.com/supp.....ials/#PIAS

- WP

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
8 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

clau_ste: 39

JimmyM: 33

Gwen: 32

EZB: 24

lppier: 23

Member Stats:

Guest Posters: 1

Members: 594

Moderators: 1

Admins: 4

Forum Stats:

Groups: 12

Forums: 37

Topics: 617

Posts: 2428

Newest Members:

channa, bvaccaro, HCassell, Max, Sim1, Chris Wade-Evans, Marlow, kcmixs2, DanieleR, jimjulian

Moderators: W Pirkle: 391

Administrators: Tom: 74, JD Young: 80, Will Pirkle: 0, W Pirkle: 391