lundi 2 avril 2018

Re-sample a signal with samples into all possible numbers of segments in Matlab

Suppose, I have a signal with 10,000 samples in a single column vector like [10000x1] matrix

sig =    -0.1272
         -0.1124
         -0.1126
            .
            .
            .

and, I'd like to re-sample/segment with all possible numbers of sets with 1,000 samples per each. When I tried to apply random buffer function with Continuous Underlapping Buffers by using the code below:

new_sam = buffer(sig, 1000);

The result generated so far is [1000x10] matrix which is for only 10 random sets of 1,000 samples.

new_sam = -0.0374    0.0622   -0.0773    0.0655   -0.0410   -0.0859   -0.0647    0.0424   -0.0615   -0.0615
          -0.0820    0.0873   -0.0822    0.0105   -0.0060   -0.0659   -0.0948   -0.0277   -0.0814    0.0036
          -0.0666    0.0475   -0.0772    0.0855   -0.0260   -0.0610   -0.0848    0.0123   -0.1014    0.0186
             .         .         .          .         .         .          .        .        .         .
             .         .         .          .         .         .          .        .        .         .

The actual sample I'd like to get is all possible number sets (more than 500 or more N random sets with 1,000 samples each) such as [1000 x N], but every 1,000 samples should be in order since they're signal values. However, each set should be randomized within a signal.




Aucun commentaire:

Enregistrer un commentaire