On Feb 19, 5:17 am, "kk KKsingh" <akikumar1...@gmail.com> wrote:
> This is a simple part of problem i posted in another thread !
>
> Suppose i have vector
> t=[1 2 3 4 5 8 10 11]
>
> I want to calculate mid point of each vector from formula
> n=0:N1
> deltat(n)=t(n+1)t(n1)/2...
Incorrect formula. MATLAB does not allow nonpositive
indices
> Now problem is that assuming that n=0:9, When n=0, I will
> get t(1) from above formula
Again, nonpositive indices are not allowed.
> As t(1) = t(N1)period and t(9)=t(0)+Period where
> period=max(t)  min (t) .... since I am talking abt periodic signal.
There is a basic problem with trying to directly
extend the DFT of a sequence that is assumed to be
a uniformly spaced sample from a periodic function
to the DFT of a sequence that is assumed to be a
nonuniformly spaced sample from a periodic function.
Typically, the seqences x[1:N] and t[1:N] are
specified with the periodic assumption
x[n+N] = x[n], n >= 1
For uniform sampling
t[n] = (n1)*dt, 1<= n <= N
with the obvious periodic extension
t[n+N] = t[n] + T, T = N*dt
Therefore, the period T is obtained from
T = t[N]  t[1] + dt
T = max(t)  min(t) + dt
Notice that this cannot be directly extended
to nonuniform sampling because dt is not
constant and t[N+1] is not defined.
Therefore, the nonuniformly sampled case must
include additional information so that t[N+1]
or T can be unambiguously determined.
The easiest way is to begin with the full
period sample x[1:M}, t[1:M} with
x[M] = x[1]
t[M] = t[1] + T
When dt is constant, the M = N+1 term DFT
result can be reduced to the familiar N
term result by using the above relationships
between the quantities at [M] and [1].
One alternative is to approximate
dt[N] = t[N+1]t[N]
as the average of the N1 differences
dt[n] = t[n+1]  t[n], 1 <= n <= N1,
i.e.,
dt[N] = (t[N]t[1])/(N1)
= (dt[N1] + dt[1])/2
Hope this helps.
Greg
