Rotating an Array: Seeking Help with Maths Skills

MM2758
Messages
5
Reaction score
0
Rotate an array
hi everyone

I'm hoping someone maybe able to help me/ point me in the right direction with the rotation of data from an array. I'll try to keep it short but my maths skills are seriously not good due to my old age and inexperience. I maybe approaching it from the wrong angle and punching well above my weight. I'm pretty good at addition and subtraction even though sometimes I get stuck on division.
icon_wink.gif


Here is a link to a spreadsheet I’m working on which hopefully will eventually end up in a program controlling a DAC for a ADSR

http://imgur.com/nAPHS3j

Column A represents a wave in voltage x being time y being voltage.
It is irrelevant what shape this is for it might be a straight line ..etc. etc.
What interests me is its entry and exit voltage which are normally 100
I have found through a lot of trial and error if I use the charts on the right (Rotate Chart & Add to F Chart) I can look up values and determine a different entry and exit voltage by rotating the wave.
So for example if I wanted a entry of 300 and an exit of 200. I would use the value in cell L5 for Rotate which is 3.3 and the value in cell L18 for the Add to F which is 150.
Now normally with a problem like this I would code a kinda lookup 3 dimensional array to get these values. But the real DAC has a voltage number range of 0-4095 which would mean an array size of 4095 raised to power 3. I think …..which is to much data for the processor I am using to store.

In this example I reduced it to 0-100 so I could see what is going on.

So my question is in an ideal world I would enter a value for the entry point and enter a value for the exit point and there would be some sort of equation which could work out from those 2 values the Rotate number and hopefully the Add to F number.

I've been stuck on this for a while hence the plea for help.

I think i tried all the functions in excel and watch you tube videos on rotation . but most of the ones i understand involve an extension of reflection

I'm not to interested in the distortion of the wave as I quiet like it (if that makes sense)thanks for reading
thanking you in advance for any guidance you can give
 
Mathematics news on Phys.org
Your original function is y(t) and the new function is z(t),
so you need a function f(t) so that z(t) = y(t)*f(t)

If the initial entry and exit points are P and desired entry and exit points are Q
then ##f(t)= \frac{Q}{P}##

If the desired exit points are different, Q0 and QT,
## f(t) = \frac{1}{P} (Q_0+ (Q_T-Q_0)\frac{t}{T})##

and if the initial entry and exit points are not equal, so P0 and PT, then the general function is
## f(t) = \frac{TQ_0 +(Q_T -Q_0)t}{TP_0 +(P_T - P_0)t}##

The main snag with this method that I can see is, if you increase the value of the entry ot exit point and there are signal values above this level, then after scaling there could be signal points above your maximum 4096. Provided you are scaling down, or using maxima as entry and exit points, then it should work.
I've not yet checked what happens if polarity changes, but I did not notice any issues where this would matter.

E&OE because my maths is very poor as well!
 
  • Like
Likes MM2758
Thanks Merlin for your reply

Now I'm going to spend the next day or so trying to understand it. and implement it ...gulp

thank you againI may well be back ...if that's ok
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
I'm interested to know whether the equation $$1 = 2 - \frac{1}{2 - \frac{1}{2 - \cdots}}$$ is true or not. It can be shown easily that if the continued fraction converges, it cannot converge to anything else than 1. It seems that if the continued fraction converges, the convergence is very slow. The apparent slowness of the convergence makes it difficult to estimate the presence of true convergence numerically. At the moment I don't know whether this converges or not.
Back
Top