thanks for all answers, I need to study them, but in the meantime I written my own answer. Please give me any feedback. And great thanks in advance.
Instead try to understand any commonly known resampling method (for sure I will do that in the future), I go my own contrariwise way: I tried to figure it out on my own in common sense.
I know there are some Lagrange interpolation method, or some method that uses sync function, but all of that seems to be complicated.
And the whole problem seems to be quite easy to manage. Probably I am wrong. But I tried to solve it in common sense.
And I’ve found my own way to make the interpolation. Of course I don’t claim I invented anything new, that nobody knows. I am even not sure if my method is proper.
That’s why I want to ask you, could you tell me about my method to which commonly known method it is closest or similar?
And in which point I could make any advantage?
So let me try to explain it. Please don’t treat it as a ready algorithm, I just try to explain the sense of it.
So let’s say we have input signal X
of size 11, and have output Y
of size 7.
Let me illustrate it:
So my first think was to graphical shrink (just for better view) input signal X
to fit to output Y
, so now it looks like that:
So for me it looks like I should share evenly each element from input to output.
For example x0
whole goes to y0
.
But x1
, some part should go to y0
and other part to y1
. Also some some part of x2
should go to y1
, other part of x2
to y2
.
x3
to y1
and to y2
.
x4
to y2
and to y3
And so on…
By “some part” and “other part” I mean exact value calculated from relationship $ \frac { Ysize - 1 } { Xsize - 1 } $. Let’s call it $p$. Of course it’s only base, and for each input I need to calculate separately those “parts”. In that example it’s $ p= \frac { 6 } { 10 } = 0.6 $. Here I am not going to go through all calculations for each input - I think it’s very easy and everybody know how to do that. I calculated already all “parts” and now I can illustrate it like that:
And now I average each output value. One could think “hmm… to y1 go three values, x1, x2 and x3, so I need to divide y1 by 3”. But of course not. There not go three values, but only parts of those values. So I divide:
$ \frac { y0 } { 1+0.4 } $;
$ \frac { y1 } { 0.6+0.8+0.2 } $;
$ \frac { y2 } { 0.2+0.8-0.6 } $
… and so on.
What do you think about that? I think it could be good for frequency representation, for example for audio graph analyser. But I am not sure if it’s OK for for straight audio signal. Could anyone give any comment?
Thanks in advance.