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
decimate in MATLAB
Started by ●January 19, 2009
Reply by ●January 19, 20092009-01-19
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? > > thanksTry turning acceleration off from MATLAB: feature accel off. If that fails, try writing your own decimation routine.
Reply by ●January 19, 20092009-01-19
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? > > thanksI typically use the 'resample' command - has always worked as expected. Darol Klawetter
Reply by ●January 20, 20092009-01-20
On Jan 19, 8:43�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: �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?
Reply by ●January 20, 20092009-01-20
On Jan 20, 12:51�am, aitezaz....@gmail.com wrote:> On Jan 19, 8:43�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: �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
Reply by ●January 20, 20092009-01-20
On Jan 20, 4:43�pm, John <sampson...@gmail.com> wrote:> On Jan 20, 12:51�am, aitezaz....@gmail.com wrote: > > > > > On Jan 19, 8:43�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: �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? > > Johnfs = 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.
Reply by ●January 20, 20092009-01-20
On Jan 20, 8:13�am, aitezaz....@gmail.com wrote:> On Jan 20, 4:43�pm, John <sampson...@gmail.com> wrote: > > > On Jan 20, 12:51�am, aitezaz....@gmail.com wrote: > > > > On Jan 19, 8:43�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: �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
Reply by ●January 21, 20092009-01-21
On Jan 20, 11:03�pm, John <sampson...@gmail.com> wrote:> On Jan 20, 8:13�am, aitezaz....@gmail.com wrote: > > > > > On Jan 20, 4:43�pm, John <sampson...@gmail.com> wrote: > > > > On Jan 20, 12:51�am, aitezaz....@gmail.com wrote: > > > > > On Jan 19, 8:43�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: �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." > > Johnyes i did ... i broke it into 5x6 decimation. it resulted in the same output :(
Reply by ●January 21, 20092009-01-21
On Jan 20, 11:40�pm, aitezaz....@gmail.com wrote:> On Jan 20, 11:03�pm, John <sampson...@gmail.com> wrote: > > > > > On Jan 20, 8:13�am, aitezaz....@gmail.com wrote: > > > > On Jan 20, 4:43�pm, John <sampson...@gmail.com> wrote: > > > > > On Jan 20, 12:51�am, aitezaz....@gmail.com wrote: > > > > > > On Jan 19, 8:43�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: �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 > > 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
Reply by ●January 22, 20092009-01-22
On Jan 21, 8:42�pm, Darol Klawetter <darol.klawet...@l-3com.com> wrote:> On Jan 20, 11:40�pm, aitezaz....@gmail.com wrote: > > > > > On Jan 20, 11:03�pm, John <sampson...@gmail.com> wrote: > > > > On Jan 20, 8:13�am, aitezaz....@gmail.com wrote: > > > > > On Jan 20, 4:43�pm, John <sampson...@gmail.com> wrote: > > > > > > On Jan 20, 12:51�am, aitezaz....@gmail.com wrote: > > > > > > > On Jan 19, 8:43�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: �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 > > > 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






