Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: frankzappa

Page 1 of 4 1 2 3 4

Search: Search took 0.00 seconds.

  1. Thanks for that tip.

    Thanks for that tip.
  2. It's just me trying to learn, it's not allowed in...

    It's just me trying to learn, it's not allowed in C++ it seems.

    I'm trying to create members that I want to be resolved at compile time. It's not a problem, I can just create them as variables...
  3. Wait, now you made the constructor constexpr....

    Wait, now you made the constructor constexpr. What does that do? It was not what I meant. I'm simply trying to create a constexpr member inside the class. It seems I can't do that.

    Here is an...
  4. uniform initialisation, object oriented programming etc.

    Hello!

    I'm learning C++ and I've just started the chapter on OOP, classes, constructors etc. There is something called "member initialisation list" where you can use direct or uniform...
  5. Replies
    15
    Views
    360

    Thank you :)

    Thank you :)
  6. Replies
    15
    Views
    360

    Yes pretty much although I compare the sign of...

    Yes pretty much although I compare the sign of sums of d(n-6) to d(n-1) with the sign of the sums of d(n-5) to d(n). I also average the midpoint of n for each sample pair of the 5 values. The peak...
  7. Replies
    15
    Views
    360

    It would be pretty symmetrical, the first 5...

    It would be pretty symmetrical, the first 5 values will be one sample offset behind the peak and the other 5 values will be one sample offset before the peak but 4 of the values in each sample pool...
  8. Replies
    15
    Views
    360

    Why can't I just save the 5 last differences...

    Why can't I just save the 5 last differences between consecutive samples and add them together. When a new sample comes in I store the previous pool of last 5 and update the current one. When the...
  9. Replies
    15
    Views
    360

    Thanks, yeah I need to look into the math....

    Thanks, yeah I need to look into the math. However it seems pretty simple.
  10. Replies
    15
    Views
    360

    This is really helpful, thanks I will do it this...

    This is really helpful, thanks I will do it this way.
  11. Replies
    15
    Views
    360

    Can you explain more in detail how these two...

    Can you explain more in detail how these two examples are done? Or maybe a link to an explanation or some keywords to google?
  12. Replies
    15
    Views
    360

    Peak tracking problem.

    Hello!

    I'm working on a project where I'm tracking peaks in amplitude and timing and I'm wondering if there is a good way to more accurately track the time occurrence of a peak.

    I have...
  13. I'm working on something I can't share. Also...

    I'm working on something I can't share.

    Also it's thousands of lines of code on multiple files.
  14. I think I figured it out. Before I did two...

    I think I figured it out.

    Before I did two calculations on the sensor signal before going to the filter. Now I'm going to the filter first, looks very clean now.
  15. This is very weird. When I change the...

    This is very weird. When I change the C_FILTERALPHA to a double in stead of float the signal gets worse on some sensors and better on others.

    I think it could be a math problem.
  16. Teensy 4. My program is huge but I can upload...

    Teensy 4.

    My program is huge but I can upload the code for the filter, it's an ewma filter:




    constexpr float C_FILTERALPHA = 0.04;
  17. Strange behaviour on certain analog reads

    Hello. I'm getting some kind of "stepping" problems on certain pins as though the average signal goes up one step and stays there and sometimes it's a step lower. I'm averaging the signal and it...
  18. Replies
    22
    Views
    612

    It's working great, this has been really helpful....

    It's working great, this has been really helpful. I love this forum, hugs to luni and KurtE :D
  19. Replies
    22
    Views
    612

    Circular_Buffer buffers[10]; Is...

    Circular_Buffer<float, 1024> buffers[10];

    Is "1024" the number of slots in the buffer or the total size in bytes?
  20. Replies
    22
    Views
    612

    Great, thanks :)

    Great, thanks :)
  21. Replies
    22
    Views
    612

    Yes I know how a ring buffer works but now I...

    Yes I know how a ring buffer works but now I realise what the setup code does, thanks.

    Another question, is the ring buffer library inside the arduino IDE or do I have to download it?

    I can't...
  22. Replies
    22
    Views
    612

    BTW: buffers[index].write(newValue); ...

    BTW:



    buffers[index].write(newValue);
    return buffers[index].read();


    .write() writes to the first index of the buffer and pushes back all the other values and .read() reads the...
  23. Replies
    22
    Views
    612

    I'm sure it's simple but for me I really needed a...

    I'm sure it's simple but for me I really needed a simple example because the examples on github are not really for beginners. They require a lot of C++ knowledge to understand. I only know some C :P...
  24. Replies
    22
    Views
    612

    Excellent, I think this will work.

    Excellent, I think this will work.
  25. Replies
    22
    Views
    612

    Well since I'm doing all the code between sensor...

    Well since I'm doing all the code between sensor readings (I start a new reading and then do calculations on the previous sensor pair while the new readings are converting) I don't actually need to...
  26. Replies
    22
    Views
    612

    I'm not really getting this part: // prepare...

    I'm not really getting this part:


    // prepare the buffers with dummy data to have the read pointer delta steps before the write pointer
    for (unsigned i = 0; i < delta; i++)
    {
    ...
  27. Replies
    22
    Views
    612

    Thanks, I'll implement this into my code :) I...

    Thanks, I'll implement this into my code :)

    I have the 600kHz readings sorted and I've already made it work great, was not easy to figure everything out though, got help here on this forum :)
  28. Replies
    22
    Views
    612

    Thanks for the code, the question is how to do...

    Thanks for the code, the question is how to do this for multiple sensors, also I need it to run as fast as possible. I have 10 sensors, all updated 600 times per millisecond and I need to run...
  29. Replies
    22
    Views
    612

    I've looked at it and it's too damn complicated...

    I've looked at it and it's too damn complicated for me right now. Seems like it would take weeks for me to learn to use the thing. I'll have to read hundreds of lines of code to do something that...
  30. Replies
    22
    Views
    612

    How to add a delay to an analog read?

    Hello, I'm reading analog sensors and want to make delayed versions of it in a set number of milliseconds or samples.

    I'm thinking something like this:




    out = delayBuffer[i];
    ...
  31. I've gone the chaotic experimental way but also...

    I've gone the chaotic experimental way but also slightly academic. The best course I've found is Neso Academy youtube video course on C, you will not find a better course on any topic anywhere. This...
  32. Replies
    4
    Views
    309

    Well I'm making an electronic drum. What I...

    Well I'm making an electronic drum.

    What I really want to do is separate the real peaks from aftershocks.

    I have a program that tracks peaks fairly accurately and it sets the threshold to decay...
  33. Replies
    4
    Views
    309

    Store values for a period of time.

    I need help with a solution to a problem.

    I want to store some calculations of sensor values (peaks etc.) for a period of time say 2 milliseconds and when that peak "expires" I want to store it...
  34. Yeah I'm aware of that and it's not something I...

    Yeah I'm aware of that and it's not something I can control. All I can do is to try send them at once and cross my fingers that the recieving side will process it as three simultaneous hits.
  35. I'm not sure what you mean by table. The log...

    I'm not sure what you mean by table. The log thing is unrelated to the original question of sensor values to indexes of a 2D array.

    I need to convert 1006 - 2500 from linear to logarithmic...
  36. I have a sensor that I peak track. I get values...

    I have a sensor that I peak track. I get values from about 1006.0f to about 2500.0f. I want to make that range logarithmic so it converts from 1006 to 2500 to 1-127 but the lower/mid values rise...
  37. Thanks, much appreciated. I'm guessing it's the...

    Thanks, much appreciated. I'm guessing it's the ones called table_lookup_JZ.
  38. Aha, yes pleaase :)

    Aha, yes pleaase :)
  39. Thanks paul, very helpful as always. I'm using...

    Thanks paul, very helpful as always.

    I'm using usbMIDI.send_now(). Ok so if I send three notes every time and I use send now it should always send them in the same package right?

    The timing may...
  40. Teensy 4 send multiple MIDI notes at once through USB.

    Hello!

    I'm wondering if it's possible to send multiple MIDI notes at once through USB midi.

    As far as I understand MIDI works sequencially sending one message at a time but I'm wondering if...
  41. Since we are discussing map functions: is there a...

    Since we are discussing map functions: is there a way to map a variable non linearly? For instance if a variable goes from 0-1023 make it 0-1023 but a logarithmic response.
  42. Ah, yes that is cleaner than what I did, thanks 😊

    Ah, yes that is cleaner than what I did, thanks 😊
  43. Also I had to limit the output to between 0 and...

    Also I had to limit the output to between 0 and 44. The map function went over and under the range.
  44. Yes I used your method but with floats and added...

    Yes I used your method but with floats and added 0.5 before converting to int. This works as it should. It rounds it to the correct value.
  45. Here is the solution, this produces accurate...

    Here is the solution, this produces accurate results:



    void setup()
    {



    }
  46. Both the suggestions produced the same result. It...

    Both the suggestions produced the same result. It discards the value. However clearly this is the way to go. I can use floats in stead and then make a function that rounds the result to the closest...
  47. Was not expecting replies this fast. Hmm......

    Was not expecting replies this fast.

    Hmm... that may work. I will try. Thanks.
    Will have to see how fast it is, I don't know what's inside the map function.



    Thanks for the suggestion. This...
  48. Function to find index in 2D array based on sensor values

    Hello!

    I need to write a program that can find the right indexes in a 2D array based off of sensor values and have no clue how to best solve this in an effecient way.

    Basically I have two...
  49. Thanks for the examples. Well right now I'm...

    Thanks for the examples.

    Well right now I'm only using the data to see what's happening and that my code is doing what it should. I'm only 30% done with the program. Later when the program is...
  50. Basically what I need to send is comma separated...

    Basically what I need to send is comma separated int and float values. Maybe I could just send it as a string, not sure if the program will accept it.
Results 1 to 50 of 162
Page 1 of 4 1 2 3 4