DSPRelated.com
Forums

decimate in MATLAB

Started by Unknown January 19, 2009
i have used the decimate command in the MATLAB with down sampling
ratio of 30. My problem is that after a few thousand samples, the
output of decimate command starts expanding (noise like thing is added
to it) whereas the input signal is quite fine. The integrity of input
signal has also been verified by starting the input signal to decimate
command from the point it gives problem. The output of the decimate
command now works fine for that particular data but again gives
problem after a number of samples from that point.
any idea?

thanks
On Jan 19, 12:30 am, aitezaz....@gmail.com wrote:
> i have used the decimate command in the MATLAB with down sampling > ratio of 30. My problem is that after a few thousand samples, the > output of decimate command starts expanding (noise like thing is added > to it) whereas the input signal is quite fine. The integrity of input > signal has also been verified by starting the input signal to decimate > command from the point it gives problem. The output of the decimate > command now works fine for that particular data but again gives > problem after a number of samples from that point. > any idea? > > thanks
Try turning acceleration off from MATLAB: feature accel off. If that fails, try writing your own decimation routine.
On Jan 18, 11:30�pm, aitezaz....@gmail.com wrote:
> i have used the decimate command in the MATLAB with down sampling > ratio of 30. My problem is that after a few thousand samples, the > output of decimate command starts expanding (noise like thing is added > to it) whereas the input signal is quite fine. The integrity of input > signal has also been verified by starting the input signal to decimate > command from the point it gives problem. The output of the decimate > command now works fine for that particular data but again gives > problem after a number of samples from that point. > any idea? > > thanks
I typically use the 'resample' command - has always worked as expected. Darol Klawetter
On Jan 19, 8:43&#4294967295;pm, julius <juli...@gmail.com> wrote:
> On Jan 19, 12:30 am, aitezaz....@gmail.com wrote: > > > i have used the decimate command in the MATLAB with down sampling > > ratio of 30. My problem is that after a few thousand samples, the > > output of decimate command starts expanding (noise like thing is added > > to it) whereas the input signal is quite fine. The integrity of input > > signal has also been verified by starting the input signal to decimate > > command from the point it gives problem. The output of the decimate > > command now works fine for that particular data but again gives > > problem after a number of samples from that point. > > any idea? > > > thanks > > Try turning acceleration off from MATLAB: &#4294967295;feature accel off. > If that fails, try writing your own decimation routine.
I tried both the resample function and feature accel off. But it doesn't work. Any idea?
On Jan 20, 12:51&#4294967295;am, aitezaz....@gmail.com wrote:
> On Jan 19, 8:43&#4294967295;pm, julius <juli...@gmail.com> wrote: > > > > > On Jan 19, 12:30 am, aitezaz....@gmail.com wrote: > > > > i have used the decimate command in the MATLAB with down sampling > > > ratio of 30. My problem is that after a few thousand samples, the > > > output of decimate command starts expanding (noise like thing is added > > > to it) whereas the input signal is quite fine. The integrity of input > > > signal has also been verified by starting the input signal to decimate > > > command from the point it gives problem. The output of the decimate > > > command now works fine for that particular data but again gives > > > problem after a number of samples from that point. > > > any idea? > > > > thanks > > > Try turning acceleration off from MATLAB: &#4294967295;feature accel off. > > If that fails, try writing your own decimation routine. > > I tried both the resample function and feature accel off. But it > doesn't work. Any idea?
Can you post the code if it's short? John
On Jan 20, 4:43&#4294967295;pm, John <sampson...@gmail.com> wrote:
> On Jan 20, 12:51&#4294967295;am, aitezaz....@gmail.com wrote: > > > > > On Jan 19, 8:43&#4294967295;pm, julius <juli...@gmail.com> wrote: > > > > On Jan 19, 12:30 am, aitezaz....@gmail.com wrote: > > > > > i have used the decimate command in the MATLAB with down sampling > > > > ratio of 30. My problem is that after a few thousand samples, the > > > > output of decimate command starts expanding (noise like thing is added > > > > to it) whereas the input signal is quite fine. The integrity of input > > > > signal has also been verified by starting the input signal to decimate > > > > command from the point it gives problem. The output of the decimate > > > > command now works fine for that particular data but again gives > > > > problem after a number of samples from that point. > > > > any idea? > > > > > thanks > > > > Try turning acceleration off from MATLAB: &#4294967295;feature accel off. > > > If that fails, try writing your own decimation routine. > > > I tried both the resample function and feature accel off. But it > > doesn't work. Any idea? > > Can you post the code if it's short? > > John
fs = 12e6; fc = 1e6; t = [0:1/fs:0.2]; data_in = fread(fid, length(t), 'double')'; hlb_out = hilbert(data_in); down_conv = hlb_out(1:length(t)).*exp(-j*2*pi*fc*t); decim = decimate(down_conv, 30, 7, 'fir'); where data_in is my input signal.
On Jan 20, 8:13&#4294967295;am, aitezaz....@gmail.com wrote:
> On Jan 20, 4:43&#4294967295;pm, John <sampson...@gmail.com> wrote: > > > On Jan 20, 12:51&#4294967295;am, aitezaz....@gmail.com wrote: > > > > On Jan 19, 8:43&#4294967295;pm, julius <juli...@gmail.com> wrote: > > > > > On Jan 19, 12:30 am, aitezaz....@gmail.com wrote: > > > > > > i have used the decimate command in the MATLAB with down sampling > > > > > ratio of 30. My problem is that after a few thousand samples, the > > > > > output of decimate command starts expanding (noise like thing is added > > > > > to it) whereas the input signal is quite fine. The integrity of input > > > > > signal has also been verified by starting the input signal to decimate > > > > > command from the point it gives problem. The output of the decimate > > > > > command now works fine for that particular data but again gives > > > > > problem after a number of samples from that point. > > > > > any idea? > > > > > > thanks > > > > > Try turning acceleration off from MATLAB: &#4294967295;feature accel off. > > > > If that fails, try writing your own decimation routine. > > > > I tried both the resample function and feature accel off. But it > > > doesn't work. Any idea? > > > Can you post the code if it's short? > > > John > > fs = 12e6; > fc = 1e6; > t = [0:1/fs:0.2]; > data_in = fread(fid, length(t), 'double')'; > hlb_out = hilbert(data_in); > down_conv = hlb_out(1:length(t)).*exp(-j*2*pi*fc*t); > decim = decimate(down_conv, 30, 7, 'fir'); > > where data_in is my input signal.
Did you notice this in the helpfile: "Note: For better results when R is large (i.e., R > 13), it is recommended to break R up into its factors and calling DECIMATE several times." John
On Jan 20, 11:03&#4294967295;pm, John <sampson...@gmail.com> wrote:
> On Jan 20, 8:13&#4294967295;am, aitezaz....@gmail.com wrote: > > > > > On Jan 20, 4:43&#4294967295;pm, John <sampson...@gmail.com> wrote: > > > > On Jan 20, 12:51&#4294967295;am, aitezaz....@gmail.com wrote: > > > > > On Jan 19, 8:43&#4294967295;pm, julius <juli...@gmail.com> wrote: > > > > > > On Jan 19, 12:30 am, aitezaz....@gmail.com wrote: > > > > > > > i have used the decimate command in the MATLAB with down sampling > > > > > > ratio of 30. My problem is that after a few thousand samples, the > > > > > > output of decimate command starts expanding (noise like thing is added > > > > > > to it) whereas the input signal is quite fine. The integrity of input > > > > > > signal has also been verified by starting the input signal to decimate > > > > > > command from the point it gives problem. The output of the decimate > > > > > > command now works fine for that particular data but again gives > > > > > > problem after a number of samples from that point. > > > > > > any idea? > > > > > > > thanks > > > > > > Try turning acceleration off from MATLAB: &#4294967295;feature accel off. > > > > > If that fails, try writing your own decimation routine. > > > > > I tried both the resample function and feature accel off. But it > > > > doesn't work. Any idea? > > > > Can you post the code if it's short? > > > > John > > > fs = 12e6; > > fc = 1e6; > > t = [0:1/fs:0.2]; > > data_in = fread(fid, length(t), 'double')'; > > hlb_out = hilbert(data_in); > > down_conv = hlb_out(1:length(t)).*exp(-j*2*pi*fc*t); > > decim = decimate(down_conv, 30, 7, 'fir'); > > > where data_in is my input signal. > > Did you notice this in the helpfile: > > "Note: For better results when R is large (i.e., R > 13), it is > &#4294967295; &#4294967295; recommended to break R up into its factors and calling DECIMATE > several > &#4294967295; &#4294967295; times." > > John
yes i did ... i broke it into 5x6 decimation. it resulted in the same output :(
On Jan 20, 11:40&#4294967295;pm, aitezaz....@gmail.com wrote:
> On Jan 20, 11:03&#4294967295;pm, John <sampson...@gmail.com> wrote: > > > > > On Jan 20, 8:13&#4294967295;am, aitezaz....@gmail.com wrote: > > > > On Jan 20, 4:43&#4294967295;pm, John <sampson...@gmail.com> wrote: > > > > > On Jan 20, 12:51&#4294967295;am, aitezaz....@gmail.com wrote: > > > > > > On Jan 19, 8:43&#4294967295;pm, julius <juli...@gmail.com> wrote: > > > > > > > On Jan 19, 12:30 am, aitezaz....@gmail.com wrote: > > > > > > > > i have used the decimate command in the MATLAB with down sampling > > > > > > > ratio of 30. My problem is that after a few thousand samples, the > > > > > > > output of decimate command starts expanding (noise like thing is added > > > > > > > to it) whereas the input signal is quite fine. The integrity of input > > > > > > > signal has also been verified by starting the input signal to decimate > > > > > > > command from the point it gives problem. The output of the decimate > > > > > > > command now works fine for that particular data but again gives > > > > > > > problem after a number of samples from that point. > > > > > > > any idea? > > > > > > > > thanks > > > > > > > Try turning acceleration off from MATLAB: &#4294967295;feature accel off. > > > > > > If that fails, try writing your own decimation routine. > > > > > > I tried both the resample function and feature accel off. But it > > > > > doesn't work. Any idea? > > > > > Can you post the code if it's short? > > > > > John > > > > fs = 12e6; > > > fc = 1e6; > > > t = [0:1/fs:0.2]; > > > data_in = fread(fid, length(t), 'double')'; > > > hlb_out = hilbert(data_in); > > > down_conv = hlb_out(1:length(t)).*exp(-j*2*pi*fc*t); > > > decim = decimate(down_conv, 30, 7, 'fir'); > > > > where data_in is my input signal. > > > Did you notice this in the helpfile: > > > "Note: For better results when R is large (i.e., R > 13), it is > > &#4294967295; &#4294967295; recommended to break R up into its factors and calling DECIMATE > > several > > &#4294967295; &#4294967295; times." > > > John > > yes i did ... i broke it into 5x6 decimation. it resulted in the same > output :(
Do you have the same problem with simple data, such as a tone? If so, we can easily duplicate your problem and debug from there. Darol Klawetter
On Jan 21, 8:42&#4294967295;pm, Darol Klawetter <darol.klawet...@l-3com.com>
wrote:
> On Jan 20, 11:40&#4294967295;pm, aitezaz....@gmail.com wrote: > > > > > On Jan 20, 11:03&#4294967295;pm, John <sampson...@gmail.com> wrote: > > > > On Jan 20, 8:13&#4294967295;am, aitezaz....@gmail.com wrote: > > > > > On Jan 20, 4:43&#4294967295;pm, John <sampson...@gmail.com> wrote: > > > > > > On Jan 20, 12:51&#4294967295;am, aitezaz....@gmail.com wrote: > > > > > > > On Jan 19, 8:43&#4294967295;pm, julius <juli...@gmail.com> wrote: > > > > > > > > On Jan 19, 12:30 am, aitezaz....@gmail.com wrote: > > > > > > > > > i have used the decimate command in the MATLAB with down sampling > > > > > > > > ratio of 30. My problem is that after a few thousand samples, the > > > > > > > > output of decimate command starts expanding (noise like thing is added > > > > > > > > to it) whereas the input signal is quite fine. The integrity of input > > > > > > > > signal has also been verified by starting the input signal to decimate > > > > > > > > command from the point it gives problem. The output of the decimate > > > > > > > > command now works fine for that particular data but again gives > > > > > > > > problem after a number of samples from that point. > > > > > > > > any idea? > > > > > > > > > thanks > > > > > > > > Try turning acceleration off from MATLAB: &#4294967295;feature accel off. > > > > > > > If that fails, try writing your own decimation routine. > > > > > > > I tried both the resample function and feature accel off. But it > > > > > > doesn't work. Any idea? > > > > > > Can you post the code if it's short? > > > > > > John > > > > > fs = 12e6; > > > > fc = 1e6; > > > > t = [0:1/fs:0.2]; > > > > data_in = fread(fid, length(t), 'double')'; > > > > hlb_out = hilbert(data_in); > > > > down_conv = hlb_out(1:length(t)).*exp(-j*2*pi*fc*t); > > > > decim = decimate(down_conv, 30, 7, 'fir'); > > > > > where data_in is my input signal. > > > > Did you notice this in the helpfile: > > > > "Note: For better results when R is large (i.e., R > 13), it is > > > &#4294967295; &#4294967295; recommended to break R up into its factors and calling DECIMATE > > > several > > > &#4294967295; &#4294967295; times." > > > > John > > > yes i did ... i broke it into 5x6 decimation. it resulted in the same > > output :( > > Do you have the same problem with simple data, such as a tone? If so, > we can easily duplicate your problem and debug from there. > > Darol Klawetter