Forum Rule: Always post complete source code & details to reproduce any issue!
Tab Content
  • frankzappa's Avatar
    03-04-2023, 05:18 PM
    I see. Edrumin with sounds would be a killer app though :D
    30 replies | 1340 view(s)
  • frankzappa's Avatar
    03-04-2023, 02:29 PM
    Are we looking forward to an edrumin with sounds in the future? :)
    30 replies | 1340 view(s)
  • frankzappa's Avatar
    03-04-2023, 02:27 PM
    You have the daisy seed that has a 480MHz processor and 16bit ADCís and also a DAC I think. Maybe Iím not allowed to say it on this forum though.
    582 replies | 165648 view(s)
  • frankzappa's Avatar
    02-10-2023, 06:30 PM
    I just change something and measure the elapsed micros to see which is faster. The unrolled was twice as fast so I kept it. It doesnít matter what anyone says, if itís faster itís faster. However the code before was...
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    02-09-2023, 08:50 AM
    Ah, I missed that. Thanks, will fix. It doesnít really do anything because the signals are usually in the thousands. Itís just in case to not divide by zero but itís pretty much impossible anyway.
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    02-09-2023, 08:41 AM
    You mean: Ēstd::max(max, 10.0f)Ē ? Thatís intentional for my use case. I donít care about max values below 80 and 10 is just noise. I used a regular for loop but it was way slower so I unrolled it manually. I...
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    02-09-2023, 07:34 AM
    However a big part of the optimisation is that I only process every other sensor reading as the requirements are not that great for this calculation. So every other time I process one sensor pair, and the next time I...
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    02-09-2023, 07:26 AM
    Sure: float CrossCorrelation::ComputeHead(int sensorID) { float max = 0.0f; //unrolled loop, the "0" is incremented every time as in a for loop m_targetSignal =...
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    02-09-2023, 05:29 AM
    Yes I have. The code was co written by chatGPT in the first place.
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    02-09-2023, 05:27 AM
    I already did that if you read my comments above :) Thanks for the suggestion.
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    02-07-2023, 03:32 PM
    I executed 10 of these calculations and printed the result, it's like 10 times faster lol. Thanks for the link and the suggestion for the optimization. This knowledge will come in handy later when I have to do a lot...
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    02-07-2023, 03:19 PM
    I changed the division to a multiplication as suggested and the program seems to work the same. I'll have to measure it.
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    02-07-2023, 03:16 PM
    Yeah I read about that but I'm not sure which compiler platformio uses. Can you show me an example how to unroll and I'll see if it works?
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    02-07-2023, 03:12 PM
    Well I should be able to save like 1000 cycles per sensor pair and that is a lot. I'm doing this for 5 sensor pairs in between the sensor readings and I only have 5 microseconds of total time to calculate a sensor pair...
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    02-07-2023, 02:59 PM
    I will try it, it would explain why it is so slow. I was expecting a lot fewer cycles. I assumed it was all the comparisons for the loop. Unrolling the loop made it twice as fast but if this works and is much faster...
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    02-07-2023, 02:49 PM
    Really? In that case then it should make a big difference. I think I read in a post on the forum that it was 1 cycle for division/multiplication/addition/subtraction with floats and two cycles for doubles. I believe it...
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    02-07-2023, 09:10 AM
    Thanks. Iíll see if it makes a difference. I think division and multiplication are the same on the teensy 4 but I havenít measured it.
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    01-23-2023, 10:01 PM
    I'm reading sensor pairs and processing the two previous pairs so it's as good as it can get I think. I'm doing all calculations while waiting for sensor reads. Problem before was I had about 5 micros before the sensor...
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    01-23-2023, 06:12 PM
    After pruning so that every other sample is used and unrolling it's now really fast. Went from 3.5 to below 1 micros per call. It's less elements but sufficient for my use case. std::array was faster but negligible....
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    01-23-2023, 04:02 PM
    I've solved it (sort of). Made it go from 3.5 microseconds per sensor to 1.7 which is good enough. I got rid of one of the loops by combining the nompalise into the function. I tried various things but unrolling the...
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    01-23-2023, 12:16 PM
    These are the functions that are run continuously and I'm wondering if there is anything I'm doing that's stupid and will waste cycles because it's pretty slow right now. I'm normalising a 1d signal of 60 elements and...
    41 replies | 1377 view(s)
  • frankzappa's Avatar
    01-23-2023, 10:22 AM
    I wrote a class that does some calculations. It compares a 1d signal with a template of a peak and calculates the absolute difference after normalisation. I have a function that triggers based on a threshold but I want...
    41 replies | 1377 view(s)
No More Results
About frankzappa

Basic Information

Statistics


Total Posts
Total Posts
268
Posts Per Day
0.23
Last Post
Low latency multi voice sample playback 03-04-2023 05:18 PM
General Information
Last Activity
03-18-2023 04:49 PM
Join Date
01-25-2020