0

I have 2 nonlinear signals generated from sensors that were taken from different drives. I wanted to ask Is it possible to change or control the step size of signal in Matlab.

My aim is to make the step size of 2 signals same though they are generated from sensor but Is it possible to do this through MATLAB and how.

What I mean by step sizes is the quantization steps as shown in figure.

enter image description here

Thanks a lot.

How to control Step size of signal in MATLAB.

What I want to do.

  • I want to down sample my signal on some decimal points .

  • Change the Step size of signal.

For DownSample I have tried so far .

  • Decimate

  • Downsample

But these commands works for Integer values but if I have some decimal Values what should I do .

So I thought of subtracting some values for samples . Take an example..

   ref=[1 2 3 4 5 6 7 8 9 10];
   x=  ref(1:3:10) 

This will lessen my samples for desired values and I change these for decimal values also.

2nd Step:

I want to control the step size of signal.

Let’s suppose my original signal has step size of 0.044 and my measured signal has step size of 0.10.

I want to make the step size of original signal equal to measured signal. (How this is possible).

I am sorry for not being able to provide u the original data as it has a lot of values.

Interpolation of signal is a way as you explained. Is there any other way to do that without interpolation?

Because I don’t want to change my data values Just want to resolve the issue by the values that I have.

1 Answers1

0

For the First question, can you interpolate the data using Interp1 function?

In the second question, i'm not familiar with that function, however it has a bandwidth property. Is it be the property that you want?

Guto
  • 541
  • 5
  • 14
  • Thanks Guto for ur reply Is it not possible without interpolation if not then I move toward interpolation –  Aug 21 '17 at 13:30
  • or even if will be able to calculate step size of my signal then may be it will be easy to make the step sizes of two signals equal . Is there anyway through which i can calculate step size of my signal? –  Aug 21 '17 at 13:34
  • I'm actually not sure exactly what you want if not an interpolation. You have an uneven sampling, making extra points in between them (basically copying the values, or in an advance method) is an interpolation. If you formulate your question in a different manner -- with for example, having a sampling data of what you have and what you want-- I or someone else may have a better answer. – Guto Aug 21 '17 at 13:42
  • 2
    You can get the differences in x-axis values using `diff(x)` where `x` is your x-axis data. So to get the minimum step size you can use `min(diff(x))`. So to interpolate at that rate, a quick and dirty example would be to use `interp1(x,y,min(x):min(diff(x)):max(x))` – Wolfie Aug 21 '17 at 14:04
  • Thanks a lot Guto and Wolfie . Please provide me sometime I will apply these stuffs on my data and update my results along with some example replica of my data as size of my data is too large so can not upload my data directly. Sorry for delay. –  Aug 21 '17 at 14:39
  • Wolfie and Guto thanks a lot for step size and I have updated a new qurrey for Ks density curve with example data please have look at that.https://stackoverflow.com/questions/45960106/histogram-bin-size-and-ks-density-curve –  Aug 30 '17 at 12:16
  • Wolfie and Guto Please have a look at the updated part . Sorry for getting late . I hope new explanation will work fine. –  Aug 30 '17 at 22:09