From: Elad Lachmi on
Hi all,
I designed a sigma-delta ADC and now I want to plot both input sine wave and the output sine wave from the decimator on the same axis. Is there any way to "fix" the decimated signal to the original time, or maybe there is a better and more specific way of doing this.

Any input will be appreciated.

Thank you!
Elad.
From: Godzilla on
"Elad Lachmi" <eladla(a)netvision.net.il> wrote in message <hsq15j$5ek$1(a)fred.mathworks.com>...
> Hi all,
> I designed a sigma-delta ADC and now I want to plot both input sine wave and the output sine wave from the decimator on the same axis. Is there any way to "fix" the decimated signal to the original time, or maybe there is a better and more specific way of doing this.
>
> Any input will be appreciated.
>
> Thank you!
> Elad

I would assign a 'time' base to be the abscissa and then plot the original time series and then hold the plot and overplot the decimated time series.
From: Walter Roberson on
Elad Lachmi wrote:

> I designed a sigma-delta ADC and now I want to plot both input sine wave
> and the output sine wave from the decimator on the same axis. Is there
> any way to "fix" the decimated signal to the original time, or maybe
> there is a better and more specific way of doing this.
>
> Any input will be appreciated.

Use explicit x values in both cases, with the x values for the decimated
signal reflecting the times in the original signal that the decimate
signal is sampled at.
From: Elad Lachmi on
Walter Roberson <roberson(a)hushmail.com> wrote in message <RF0In.14060$0M5.4463(a)newsfe07.iad>...
> Use explicit x values in both cases, with the x values for the decimated
> signal reflecting the times in the original signal that the decimate
> signal is sampled at.

This is exactly what I`m asking how to go about.

Thank you all for your replies!
From: Walter Roberson on
Elad Lachmi wrote:
> Walter Roberson <roberson(a)hushmail.com> wrote in message
> <RF0In.14060$0M5.4463(a)newsfe07.iad>...
>> Use explicit x values in both cases, with the x values for the
>> decimated signal reflecting the times in the original signal that the
>> decimate signal is sampled at.

> This is exactly what I`m asking how to go about.

Would your question happen to be about Simulink? If so, then I don't
know the answer.

What decimation process are you using? If you were to feed the decimator
the integers 1:length(signal) then would it decimate the same way as
when you fed it the signal itself? If so then you can do that, and then
use 1:length(signal) as the x for the first plot, and the decimated
integers as the x for the second plot. Or divide each of those x by the
frequency to convert to time:

plot((1:length(signal))/Fs, sinewave, 'r', decimatedtime ./ Fs,
decimatedwave, 'g')