MATLAB Answers

How to invert a sample?

17 views (last 30 days)
I'm doing a project related to DSP. I have a doubt regarding sampling. My project is about inverting the samples of an audio signal. My doubt is how to invert samples by using MATLAB. For example if we take 16 samples the 0th sample should be 15th and the 15th sample should be 0th one. Can you please help me implement this in MATLAB.

  5 Comments

Show 2 older comments
Paulo Silva
Paulo Silva on 3 Mar 2011
1th should be more correct for the first sample than 0th sample, 0 usually means none or nothing, not the first of!
Sean de Wolski
Sean de Wolski on 3 Mar 2011
Whoever tagged "iddon'treaddocumentation', love it!
Paulo Silva
Paulo Silva on 3 Mar 2011
I know that person, he's crazy!

Sign in to comment.

Accepted Answer

Sean de Wolski
Sean de Wolski on 3 Mar 2011
doc fliplr
doc flipud

  5 Comments

Show 2 older comments
ramya
ramya on 3 Mar 2011
I want to implement this by using matlab.The functions what the sean has mentioned are they regarding matlab???how can i use those and implement the inversion of samples
Paulo Silva
Paulo Silva on 3 Mar 2011
please read matlab's documentation and don't expect others to give you the complete code.
ramya
ramya on 3 Mar 2011
Thank u for ur valuable suggestions.........

Sign in to comment.

More Answers (2)

Paulo Silva
Paulo Silva on 3 Mar 2011
Ok here's my worst code to do that for you
Sample=[3 4 5 7 9 8 4 3 5 6 7]
OutSample=[];
for lo=numel(Sample):-1:1
OutSample=[OutSample Sample(lo)];
pause(1) %the loop is too fast, lets slow it down
end
OutSample

  6 Comments

Show 3 older comments
Paulo Silva
Paulo Silva on 3 Mar 2011
ramya please accept Sean's answer, although he didn't make your code he did provide the necessary tips.
ramya
ramya on 3 Mar 2011
sean what the statement u have given is working thank uuu and it made my work easier...thank uuuuuu
ramya
ramya on 3 Mar 2011
yes Sean's answer is correct and it made my work more easier.....

Sign in to comment.


Kandhavel A
Kandhavel A on 3 Mar 2011
use can use selector switches which works based on index we provide

  1 Comment

ramya
ramya on 3 Mar 2011
how can i implement inversion for samples by using matlab....

Sign in to comment.

Categories


Translated by