Background, I am realizing a filter bank of FIR filters that involve matrix operations on Array{ComplexF64,2}. Every time I take a slice, it turns into an Array{ComplexF64,1} and I have to reshape to get it back into an n by m array before I can do further operations on it. Is there some way I can take a slice and have it remain as nx1, rather than a 1 dimension array or do I have do a reshape after taking each slice?
Sure, that’s a vaild point. I am also note sure why a matrix is really needed. A vector should work just fine and would be easier to debug imo if something goes wrong later (assuming this is part of some larger code).
The examples have been a bit contradictory but I suspect that either it’s not really necessary to extract slices or things would become easier by transposing the entire problem so the filters are columns instead of rows.
Gunnar, my understanding is it’s better to use columns for the variable that iterates in the inside loop. For filters, I tend to reserve this for containers that have elements changing with time. Hence, the use of rows for each stage of a cascade filter. I should also mention again that all the filters are complex; for the special case of real inputs, they can be simplified to real filters, but this often adds complexity as then often one must then guarantee all poles occur in complex conjugate pairs, “clean” them when they are not exactly complex conjugate etc. So unless I need the time and or/space optimizations, I generally leave the filters as complex, at least when first developing them for a particular application. Also, I am working on filter banks, so if I want them to be usable for phased-array applications, then again I prefer to have them as complex, at least for now. My personable opinion (not shared by others as far as I can tell), is that complex signal processing is actually cleaner and simpler than “real” signal processing.