CASApythonPort
                                
                                
                                
                                    CASApythonPort copied to clipboard
                            
                            
                            
                        Running Duet and Output File Type
First let me say, I'm very impressed with these scripts. Thank you for the effort you put into it. Though, I have two questions/issues. Bear in mind I'm somewhat of a novice.
- 
The first issue I have is that I'm not sure how to call run_duet.py, I'm not sure what arguments it needs, or how to point to it for that matter. I did recreate the source separation step by step in the run_duet.py at least. It took a while, around 90 lines or so. Anyway, I ended up being able to plot each np array of the est[i]. So I'm not sure how to call this script, and what arguments to specify. Or do I have to edit the run_duet.py file every time I want to attempt BSS? For example, the number of sources would probably be different each time, as well as file names of the observation signals.
 - 
Second issue is regarding the output file type. The last for loop creates 5 output files called 'out' from the est[i] np arrays, but the fie type of 'out0' 'out1' ect, are all plain files. I cannot play the files in this format to actually hear the separated signals. I tried adding + '.wav' to concatenate with 'out'+str(i) but that resulted in the media not being able to be played by audio controls/media player.
 
Please advise,
Thank you
--EDIT--
By adding '.wav' and a .astype(float32) it was able to be recognized by my computer. But question #1 still stands.
I would like to add a third issue:
- Can someone advise on the feasibility of scaling up with number of source observation signals? In the example there are two, and that makes it convenient to plot the peaks in 3d, but once we get to higher dimensions, how do we know where the peaks are? np.argmax() ? Or will the dimensionality always be 1D aphas 1D deltas and thus be able to be plotted in that fashion regardless of how many observation signals (not sources to be separated) are provided? Some the the linear algebra there is a bit over my head, so I thought I'd raise this concern here.
 
Hello! It's been a really long time since I've looked at this code, but I'll try to help the best I can.
- 
It's meant to be a standalone script, so just running
run_duetshould work. Of course, since I've not parameterised anything, you'd have to change the input sources (in line 28, 29),num_sourcesin line 131, and so on. A PR to add this functionality would be very appreciated! - 
Glad this was fixed!
 - 
I'm afraid I don't know the answer to this; the code was written only keeping two sources in mind, so i am not sure what would be the best way to extrapolate to higher dimensions.
 
Hey!
Thank you for taking another look at it. Great idea by the way -- it's so useful to have a Python version of DUET.
Issue 1 was mostly my user error, and 2 was a quick fix. Lets see if any one else knows how to answer 3. Clearly past 3 dimensions it will be hard to plot in the same manner, but perhaps the algorithm can still work. The part I'm most confused about is the np arrays called delta peaks and alpha peaks. I know what they are doing, but I'm not sure how the alpha/delta peaks would change if we added more observation signals. Maybe we'd have to add a new series, theta peaks or something? I'm just thinking out loud, feel free to take your time and think it over, time permitting.
--EDIT-- There is no rush for issue #3. Right now I'm still taking a proof of concept approach to it. The example wav files were separated really well. However, when I tried using it with my 2 mixed observation .wavs, the results weren't nearly as good -- even after using the 3d plot to map out my data's alpha peaks and delta peaks. Is there anything else that I need to change if I use different .wavs?
And just out of curiosity, why is freq set to a sawtooth-like signal? Is that robust to all observation signals we input?
And maybe the biggest thing I'm having trouble with is how to tell which delta/alpha peak pair corresponds to which source?