removal beginning of samples from input speech

I have a signal added with some random noise. in that, as per my algo I have to eliminate initial samples. I tried using transpose like x=y(100000:end,1).'; but finally, x showing empty matrix. any suggestions to eliminate my beginning samples ?

 Accepted Answer

It looks like you were close...
If your signal is a vector named 'y', first confirm the amount of data you have in y.
size(y)
If you want to eliminate the first 100000 elements,
x = y(100001:end);
%or
y(1:100000) = [];
if y is a matrix,
x = y(100001:end, :); % allcolumns
x = y(100001:end, 1); % from col 1
%or
y(1:100000, :) = [];
If this doesn't solve your problem, please specify what went wrong or perhaps attach a mat file with your data.

6 Comments

hi adam, its worked out well. thank you so much.
i have a signal with 2 cols and 6000+ rows. i want to remove first 500 samples from it. signal's length is 3600. ECG_Sig(1:500, :)= [];
disp(length(ECG_Sig))
on this error is Matrix index is out of range for deletion.
@Javeria, I don't follow. Is your matrix 6000-by-2 as is stated in your first sentence or 3600-by-2 as is suggested in your 3rd sentence?
The length function can be misleading. If you want to know the number of rows use height(x) or size(x,1) or if you want the number of columns, use width(x) or size(x,2).
Lastly, always share full copy-pasted error messages - they often contain helpful hints.
I have this file i want to remove first 500 samples from it
btw can you tell me if I have this 100.mat file that i attached above it has two columns i want to convert this file into 2D RGB image. ist cl= red, 2nd= green what will be blue?
Do the followling.
  1. Clear you workspace using the clear command.
  2. Load the mat file (drag it into your command window.
  3. Look at the Workspace window to see your variables and their sizes. If you don't see your workspace window use the workspace command to make it appear.
The image below shows your workspace variable which should answer your questions.

Sign in to comment.

More Answers (0)

Categories

Find more on Signal Processing Toolbox in Help Center and File Exchange

Asked:

on 14 Aug 2018

Commented:

on 14 Dec 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!