CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.

I found a few bugs, most important one is that the amplitude axis of the impulse response plot was missing. I also added axis labels.
And I optimized the fft used to plot FIR filters, it's about 4x faster now!


New versions:
Backend:Release v0.5.1 * HEnquist/camillagui-backend * GitHub
pycamilladsp-plot: Release v0.4.2 * HEnquist/pycamilladsp-plot * GitHub

Working faster as expected @Henrik :up:

Nice feature, that one can see the "gain" so to help avoid clipping!
MUST SAY again Henrik, you are doing a really really great job; thanks a lot man :)

Jesper
 

TNT

Member
Joined 2003
Paid Member
Using rePhase - Official Site - Free FIR filtering tool to generate FIR textfiles and comparing the Camilla plots (old version), they don't look the same - Camilla presents a lot more wiggles.

I tested 2 filter versions; one with only a phase adjustment (dashed line is phase, solid is level) and one with both phase and level EQ.

Both had a -6 dB gain adjustment in the filter.

In the "only phase" Camilla plot, it should be a straight line, no?

//
 

Attachments

  • onlyPh.png
    onlyPh.png
    55.7 KB · Views: 218
  • ph camPlot.png
    ph camPlot.png
    433.3 KB · Views: 200
  • ph+eq.png
    ph+eq.png
    65.7 KB · Views: 195
  • ph+eq camPlot.png
    ph+eq camPlot.png
    273.6 KB · Views: 186
Last edited:
This make sense too!

Makes me wonder: Where is "0 dB" placed in the floating world?

At -192 (out 384)?

//
0dBFS is still in the same place a 64 bit integer can represent a 384dB range but the 32 bit Floating Point number can represent a 1528dB range which allows for volume scaling i.e. numbers above 0dBFS so they can be pulled back down afterwards and still get the correct data. This is why the headroom is unlimited as far as practical audio is concerned.

There's an article here that might be useful, it's describing files rather than processing but the information should explain the mechanics of it

32-Bit Float Files Explained - Sound Devices
 
Using rePhase - Official Site - Free FIR filtering tool to generate FIR textfiles and comparing the Camilla plots (old version), they don't look the same - Camilla presents a lot more wiggles.
The wiggles are created by an interpolation step I added to reduce the number of points in the curves (to make plotting faster). The first version wasn't doing a good job with fir filters. It's fixed in the latest version of pycamilladsp-plot.

Yes 0 dB is 0 dBfs i.e. all bits being one's (1) (excluding 1's complements).

But how is Camilla structured internally. Is there a digital headroom provided, i.e. everything incoming is scaled down X dB to accommodate calculations etc...?

//
CamillaDSP uses floating point math internally so the headroom is huge. The 64-big float format is roughly equivalent to 15 digits of precision, and because it's floating point a number keeps the same precision also if you divide it by some other number.
Binary floating point is a bit messy but let's make an example with decimal numbers. Let's say we have a floating point format that stores with 4 digits, and exponent and sign. Then we could have the number 1.234 *10^0 (so just 1.234). Now let's divide it by 100. Then we get 0.01234 *10^0. But we can only keep 4 digits so we don't return this as the result yet. We want a non-zero before the decimal point. So we rewrite it as 1.234 *10^-2 and this is our result. Still with 4 digits. This happens for every operation on floats. The result is always adjusted so all the digits are used.

At the output camilladsp will clamp the signal to the -1.0 - +1.0 range before converting to the selected output format. Anything outside the range will simply be set to +/-1.0. This is where the clipping warning messages are coming from.
 
Last edited:
Managed to compile 0.4.0 and pycamilladsp-plot on windows. Works great!
Still wish for:
Code:
   def groupdelay(self,f):
        _f, Avec = self.complex_gain(f)
        groupdelay = [cmath.groupdelay(A) for A in Avec]
        return f, groupdelay
What is Group Delay
Thanks for the feedback!

Since I don't use numpy any more it takes a little more work to make the group delay plots. The calculation is simple, but the phase must first be unwrapped. There is a clever routine in numpy for this but now I must make my own. The next release of the gui will just be for bugfixes. After that I will take a look at this.
 
Beta-6 installed and quick-tested on my pCP Rpi - OK..!

I actually used synchronous up-sampling from 24k to 48k for low res radio stream. If the noise was half input sample rate, it would be at 12kHz..?
Lucky me I don't hear anything over 10k anyway... ;)


Edit:
oups... chaned beta no.
 
Last edited:
I actually used synchronous up-sampling from 24k to 48k for low res radio stream. If the noise was half input sample rate, it would be at 12kHz..?
The noise was at half the target samplerate so the interpolation filter of most dacs would get rid of most of it. Probably why it went undetected for so long :)


Does Camilla use NEON instructions when compiled on ARM / Pi platforms?
Yes, if you ask for it (see the readme) the compiler uses NEON via auto-vectorization. There aren't so many loops where it manages to do that so in practice it doesn't give very much improvement. Depending on what filters etc you use you will get a speedup of 0 to 10%.
 
The latest on debian repository is 1.41.1. only by switching to sid(unstable) there is the newest version. About the "uint" error following the compiler suggestion (adding std::) will fix the error. About the matches macro, is there a way to substitute it with a function that doesn't brake compatibility with "older" rustc versions?
 
The latest on debian repository is 1.41.1. only by switching to sid(unstable) there is the newest version. About the "uint" error following the compiler suggestion (adding std::) will fix the error. About the matches macro, is there a way to substitute it with a function that doesn't brake compatibility with "older" rustc versions?
Rust is moving fast and the versions provided by the various linux distributions are usually "old". The recommended way to install it is by using rustup: rustup.rs - The Rust toolchain installer


If you want to use the older compiler, then change to the deprecated "std::usize" and replace the matches! macro with the version before this commit: Clippy warnings * HEnquist/camilladsp@356ee73 * GitHub