How to invert a sample?
Mostra commenti meno recenti
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 Commenti
Paulo Silva
il 3 Mar 2011
0th sample?! are you sure you are doing DSP related project?
ramya
il 3 Mar 2011
Paulo Silva
il 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
il 3 Mar 2011
Whoever tagged "iddon'treaddocumentation', love it!
Paulo Silva
il 3 Mar 2011
I know that person, he's crazy!
Risposta accettata
Più risposte (2)
Paulo Silva
il 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 Commenti
Sean de Wolski
il 3 Mar 2011
You can also just ">> open fliplr" and see the easy vectorized method.
Paulo Silva
il 3 Mar 2011
Sean that's obviously too complicated
ramya
il 3 Mar 2011
Paulo Silva
il 3 Mar 2011
ramya please accept Sean's answer, although he didn't make your code he did provide the necessary tips.
ramya
il 3 Mar 2011
ramya
il 3 Mar 2011
Kandhavel A
il 3 Mar 2011
0 voti
use can use selector switches which works based on index we provide
1 Commento
ramya
il 3 Mar 2011
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!