DSPRelated.com
Forums

zero padding in matlab

Started by rakesh5454 June 26, 2006
could some1 plz help me out with this....!!!!

i have two wave files. 1 is speech and other is music file. obviously
their sizes would be different. i would like to mix both of them and
find the energ of the resultant signal. for this if we zero pad 1 then
make the size sam we can both. could some1 write a code for it. i 'm a
new bee and donno whether i can ask this here r not.... but some1 try
to help me out....

thanks for ur time....!!!

rakesh5454 wrote:
> could some1 plz help me out with this....!!!! > > i have two wave files. 1 is speech and other is music file. obviously > their sizes would be different. i would like to mix both of them and > find the energ of the resultant signal. for this if we zero pad 1 then > make the size sam we can both. could some1 write a code for it. i 'm a > new bee and donno whether i can ask this here r not.... but some1 try > to help me out.... > > thanks for ur time....!!!
First, no one ("no 1" as you probably would write it) are willing to spend any time on helping you if you are not willing to spend time on formulating a question. This is an international forum, and lots of the participants are not fluent in English, so nobody are required to write perfect all the time. However, spelling out the words as best one can *does* add to the impression that asking the question is important to you, and that it may be worth somebody else's while to help out. As for what you attempted to ask for: [N1,Ch1]=size(data1); [N2,Ch2]=size(data2); data1zp = [data1;zeros(N2-N1,Ch1)]; Rune
Sorry everybody,  i was not thinking of anything except the question
while writing the query. will see that it wont repeat in future. my
sincere apologies Rune and thanks for the code.

rakesh

Rune Allnor wrote:
> rakesh5454 wrote: > > could some1 plz help me out with this....!!!! > > > > i have two wave files. 1 is speech and other is music file. obviously > > their sizes would be different. i would like to mix both of them and > > find the energ of the resultant signal. for this if we zero pad 1 then > > make the size sam we can both. could some1 write a code for it. i 'm a > > new bee and donno whether i can ask this here r not.... but some1 try > > to help me out.... > > > > thanks for ur time....!!! > > First, no one ("no 1" as you probably would write it) are willing to > spend any time on helping you if you are not willing to spend time > on formulating a question. This is an international forum, and lots of > the participants are not fluent in English, so nobody are required > to write perfect all the time. However, spelling out the words as > best one can *does* add to the impression that asking the question > is important to you, and that it may be worth somebody else's > while to help out. > > As for what you attempted to ask for: > > [N1,Ch1]=size(data1); > [N2,Ch2]=size(data2); > data1zp = [data1;zeros(N2-N1,Ch1)]; > > Rune