How to invert a sample?

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 件のコメント

Paulo Silva
Paulo Silva 2011 年 3 月 3 日
0th sample?! are you sure you are doing DSP related project?
ramya
ramya 2011 年 3 月 3 日
0th sample means first sample of the signal...im doing project on DSP kit TMS320C6713,and first im implementing this by using the matlab....
Paulo Silva
Paulo Silva 2011 年 3 月 3 日
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 2011 年 3 月 3 日
Whoever tagged "iddon'treaddocumentation', love it!
Paulo Silva
Paulo Silva 2011 年 3 月 3 日
I know that person, he's crazy!

サインインしてコメントする。

 採用された回答

Sean de Wolski
Sean de Wolski 2011 年 3 月 3 日

3 投票

doc fliplr
doc flipud

5 件のコメント

ramya
ramya 2011 年 3 月 3 日
can u pls give me a solution how to invert samples by using matlab
Paulo Silva
Paulo Silva 2011 年 3 月 3 日
Sean just gave you two functions you might need, you didn't bother to see what they do did you?
ramya
ramya 2011 年 3 月 3 日
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 2011 年 3 月 3 日
please read matlab's documentation and don't expect others to give you the complete code.
ramya
ramya 2011 年 3 月 3 日
Thank u for ur valuable suggestions.........

サインインしてコメントする。

その他の回答 (2 件)

Paulo Silva
Paulo Silva 2011 年 3 月 3 日

1 投票

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 件のコメント

Sean de Wolski
Sean de Wolski 2011 年 3 月 3 日
You can also just ">> open fliplr" and see the easy vectorized method.
Paulo Silva
Paulo Silva 2011 年 3 月 3 日
Sean that's obviously too complicated
ramya
ramya 2011 年 3 月 3 日
thank u....tis code is working..thank u so much..
Paulo Silva
Paulo Silva 2011 年 3 月 3 日
ramya please accept Sean's answer, although he didn't make your code he did provide the necessary tips.
ramya
ramya 2011 年 3 月 3 日
sean what the statement u have given is working thank uuu and it made my work easier...thank uuuuuu
ramya
ramya 2011 年 3 月 3 日
yes Sean's answer is correct and it made my work more easier.....

サインインしてコメントする。

Kandhavel A
Kandhavel A 2011 年 3 月 3 日

0 投票

use can use selector switches which works based on index we provide

1 件のコメント

ramya
ramya 2011 年 3 月 3 日
how can i implement inversion for samples by using matlab....

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by