LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can you crossfade (fade in/out) arrays?

Milq something i would like to add
 
In your answer number 4, any voiced segment is broken down into as many sub-chunks as needed according to the period and period is not always a standard number otherwise it would be easier for the sake of all of us, but as you said this is my work which i have done Smiley Happy....I am wondering about the "havoc" you are mentioning about the first and last sub-chunk mostly...is this coming from the fact that in your code  you get whatever number of sub-chunks and group them in pairs? therefore the problem with the odd-even number of them?.....
as far as the rest of your explanation i couldnt have said it better
 
By the way, how can i playback the signal at the point where i am in my code, where no scaling took place yet.I tried the vis in the graphics&sound>sound and i was not able to.... 
0 Kudos
Message 41 of 85
(1,448 Views)

Ok, I'm getting there...

Request: madgreek, can you please do the following:

1. Take the data from 'hijacked.wav'.  This will be a moderately large 1D array of 8-bit sound samples.

2. Use 'Reshape Array' to reorder this as a 2D matrix.  It will be n rows (the first size input) by m columns (the second size input) where m is the # of samples in each individual chunk and n is the # of chunks in the whole wave.   I could do this, but I don't know the criteria for choosing chunk size.  If chunk size can vary, then this step would need to be handled differently.

3. For each row of that 2D matrix, evaluate whether it is voiced or unvoiced.  Create a new 1D integer array with n elements, one for each row of the 2D matrix.   The integer value should represent the # of samples to use for each sub-chunk, assuming 50% overlap.  Use an integer value of 0 to identify 'unvoiced' rows.

4. Note & reminder: Please no Hanning or other windows yet.  The 2D matrix should simply contain the raw 'hijacked.wav' sound samples, simply re-shaped from 1D to 2D.

5. Create front panel indicators for the 2D matrix and the 1D array.  Run your code and verify that you've produced good results for the 2D and 1D array.

6. With data in the 2D and 1D arrays, select them and perform an "Edit-->Copy" operation.

7. Create a brand new vi.  Perform "Edit-->Paste"

8. Find the menu choice for "Make Current Values Default".  Under 7.x, I think it's in the "Operate" menu.

9. Save this new vi (which will be pre-loaded with valid useful data).  Shut down LabVIEW then re-open the vi to verify that the data truly was saved as default inside it.  Then post it.

10.  If you've been able to re-create milqman's code in version 7, please post that too.  With that, I can work in 7.1 and save back to 7.0 for posting.

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 42 of 85
(1,436 Views)
i know guys that you are way too busy but if the answer to this doesnt take too much time can you please point me to the correct direction, otherwise forget about it
 
lets say i have 3 1-D arrays of 256 each and i want to break down the first one to sub-arrays of length 60 each, the second one to 65 and the last one to 70 and all this done sequentially.
the first one will be divided into 4 sub-arrays of 60 samples each and leave 16 samples unused. My question is can i add those last 16 samples (remainder) to the second array (16+256=272) and then divide it into sub-arrays of 65 each? And this procedure to be repeated again?
 
Again i am really sorry if i am too pushy...
 
Regards
Madgreek
 
0 Kudos
Message 43 of 85
(1,434 Views)
Yes,

Though to avoid extra effort, I would just concatenate all 3 256 arrays at the beginning (into one 768 array) then just do something simple to split them out.  See attached picture.

~milq
0 Kudos
Message 44 of 85
(1,430 Views)
Kevin
 
I tried to do what you asked me but i cant because chunk size varies. To be able to correctly get the chunk sizes and be able to tell which ones are voiced or unvoiced i have to go thru my code and the closest thing i can get to what you asked me is a 3D array. I tried then that 3D to get into a 2D but i get a bunch of extra arrays full of zeroes.
 
Milq
 
i dont always know how many to concatenate and to what size sub-arrays to break them down.
 
Guys you dont know how embarrassed i feel for not being able to answer your simple questions  or be able to help more with my s..... thing....and even more for wasting your own time....i am really sorry...i hate me Smiley Sad
 
 
0 Kudos
Message 45 of 85
(1,425 Views)
2 things now:

1. Each chunk is treated as an independent 1D array, right?  You can extract this 1D array chunk of whatever size, then build it into a cluster using the "Bundle" function.  Now you've got a cluster of an array.  Then you'll be able to build up a 1D array of these clusters, where each cluster element holds a variable-length 1D array of samples, i.e., a "chunk."   This would be analogous to the 2D array I asked for earlier.

2. Unfortunately, the idea that chunk sizes can be variable came as a surprise to me.  I'm back to being not so sure I understand again...

-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 46 of 85
(1,416 Views)
Hi Kevin
 
Right now i am trying to make some changes in my code so as to eliminate some parts that would introduce noise to the modified signal later on. As soon as i finish this i will do what you asked me and post it....probably later tonight.....
 
p.s. The size of arrays goes like this....all arrays are the same size initially.....unvoiced arrays are all the same size (256) and are kept like that....if an array is said to be voiced is broken down from the 256 that is, to smaller sub-arrays of same size (i.e 64). The only difference is the size of these sub-arrays differ from voiced array to voiced array.
 
The size of the sub-arrays depend on the period length. I have attached a 1D array that each element represents an array of 256 long and shows which are voiced or unvoiced.
 
I will get back with what you asked me to do later on tonight.
0 Kudos
Message 47 of 85
(1,413 Views)
i forgot to attach the array
0 Kudos
Message 48 of 85
(1,410 Views)

p.s. The size of arrays goes like this....all arrays are the same size initially.....unvoiced arrays are all the same size (256) and are kept like that....if an array is said to be voiced is broken down from the 256 that is, to smaller sub-arrays of same size (i.e 64). The only difference is the size of these sub-arrays differ from voiced array to voiced array.

Hmmm, now this sounds more like what I thought I kinda understood.  So let me just try to get perfectly clear.  I'm referring *only* to pitch-shifting with no intention of applying time-shifting.

  • The sound file gets evaluated and processed using a fixed 256-sample chunk size.  No overlap between chunks.
  • If the 256-sample chunk evaluates as "unvoiced" it passes through untouched as a 256-sample output.
  • If the 256-sample chunk evaluates as voiced, then an evaluation of period length and a compression/expansion factor determines how to sub-divide and merge those samples.  Whatever is done, the result will still be a 256-sample output, at least for the case of pitch-shifting alone.

-Kevin P.

P.S.  Friendly reminder -- if you've implemented milqman's code in LV 7, please post it.

 

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 49 of 85
(1,405 Views)
I can say for certain that my code is not going to like having different sized pitch segments.  If you want to utilize what I put together, you guys are going to have to be very picky about keeping similarly "voiced" things together and separating "voiced" portions of slightly different pitches (into separate inputs to my little chunk of code).  I don't know how much work it will take to convert my code into something that will be accepting of different sized pitch segments (it was a pretty fundamental assumption going in to the creation of that VI, hence the 2D array inputs and such).  I suppose if the segments are "close" you might be able to pad the smaller chunks with 0's on each side (they would be there post window anyway) and let a rip.  It is up to you guys, my LV experience in somewhat limited, Kevin may be able to pick up on the good parts of my magic and ignore the rest (thereby coming up with something better than mine that does all the same cool stuff), hard to tell.

This is a fun problem, I am looking forward to seeing what you guys come up with,
~milq
0 Kudos
Message 50 of 85
(1,399 Views)