http://www.mathworks.com/matlabcentral/newsreader/view_thread/325381
MATLAB Central Newsreader  reshape?
Feed for thread: reshape?
enus
©19942015 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Mon, 24 Dec 2012 05:17:49 +0000
reshape?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/325381#894224
hadi motamedi
Dear All<br>
To send a speech wave signal through a noisy channel , I tried as :<br>
>[y,Fs]=wavread('speech.wav');<br>
>x=(0.999/(max(ymin(y)))*(ymin(y));<br>
>n=4;<br>
>y1=floor(2^n*x);<br>
>b1=de2bi(y1,'leftmsb');<br>
>b11=reshape(b1.',numel(b1),1);<br>
To this end, I have the original data in binary form suitable to send through a noisy channel. The matrix [y1] contains the digits and the matrix [b11] contains the bits to be sent through the noisy channel. Please consider the matrix [b11p] to be the received noisy binary data . Can you please let me know how can I convert it back to the digits to be able to play the noisy wave sound?<br>
Thank you

Tue, 25 Dec 2012 05:18:08 +0000
reshape?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/325381#894256
Roger Stafford
hadi motamedi <motamedi24@gmail.com> wrote in message <ee1244b1d37941d681e42d7360332aa5@googlegroups.com>...<br>
> Dear All<br>
> To send a speech wave signal through a noisy channel , I tried as :<br>
> >[y,Fs]=wavread('speech.wav');<br>
> >x=(0.999/(max(ymin(y)))*(ymin(y));<br>
> >n=4;<br>
> >y1=floor(2^n*x);<br>
> >b1=de2bi(y1,'leftmsb');<br>
> >b11=reshape(b1.',numel(b1),1);<br>
> To this end, I have the original data in binary form suitable to send through a noisy channel. The matrix [y1] contains the digits and the matrix [b11] contains the bits to be sent through the noisy channel. Please consider the matrix [b11p] to be the received noisy binary data . Can you please let me know how can I convert it back to the digits to be able to play the noisy wave sound?<br>
> Thank you<br>
        <br>
I am a somewhat puzzled by your question. Being able to convert the noisy bits back to integers depends very much on b11p not having lost or gained bits along the way and thereby affecting the way the bits are clustered in groups of n bits each. If you haven't lost phasing in this manner, reversing your procedure by reshaping b11p to restore the n columns of bits and this time using bi2de, would get you back to a noisy version of y1  that is, integers between 0 and 2^n1. Note that altering bits toward the most significant end of a group would have a serious effect on these restored integers. However, there is clearly no way to restore the original x, much less the y, values unless you have more information than is possessed by b11p.<br>
<br>
Roger Stafford

Sat, 29 Dec 2012 08:30:08 +0000
Re: reshape?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/325381#894475
hadi motamedi
On Tuesday, December 25, 2012 8:48:08 AM UTC+3:30, Roger Stafford wrote:<br>
> hadi motamedi <motamedi24@gmail.com> wrote in message <ee1244b1d37941d681e42d7360332aa5@googlegroups.com>...<br>
> <br>
> > Dear All<br>
> <br>
> > To send a speech wave signal through a noisy channel , I tried as :<br>
> <br>
> > >[y,Fs]=wavread('speech.wav');<br>
> <br>
> > >x=(0.999/(max(ymin(y)))*(ymin(y));<br>
> <br>
> > >n=4;<br>
> <br>
> > >y1=floor(2^n*x);<br>
> <br>
> > >b1=de2bi(y1,'leftmsb');<br>
> <br>
> > >b11=reshape(b1.',numel(b1),1);<br>
> <br>
> > To this end, I have the original data in binary form suitable to send through a noisy channel. The matrix [y1] contains the digits and the matrix [b11] contains the bits to be sent through the noisy channel. Please consider the matrix [b11p] to be the received noisy binary data . Can you please let me know how can I convert it back to the digits to be able to play the noisy wave sound?<br>
> <br>
> > Thank you<br>
> <br>
>         <br>
> <br>
> I am a somewhat puzzled by your question. Being able to convert the noisy bits back to integers depends very much on b11p not having lost or gained bits along the way and thereby affecting the way the bits are clustered in groups of n bits each. If you haven't lost phasing in this manner, reversing your procedure by reshaping b11p to restore the n columns of bits and this time using bi2de, would get you back to a noisy version of y1  that is, integers between 0 and 2^n1. Note that altering bits toward the most significant end of a group would have a serious effect on these restored integers. However, there is clearly no way to restore the original x, much less the y, values unless you have more information than is possessed by b11p.<br>
> <br>
> <br>
> <br>
> Roger Stafford<br>
<br>
Thank you for your reply<br>
I tried as :<br>
>b11P=reshape(b11p.',4,100000);<br>
>b1s=b11P.';<br>
>y1t=bi2de(b1s,'leftmsb');<br>
>x1f=(2^(n))*y1t;<br>
>wavplay(x1f,Fs)<br>
And it was successful. Thank you for your help