463 karma · joined February 3, 2014
It's wild that that number is wedged so deeply into my brain, like a lot of things that were on my mind as a teenager. Makes me want to make sure my kids are doing something worthwhile when they're that age (which I know is futile of course).
Generating a spectrum with a given magnitude distribution and uniform phase distribution is pretty common (at least in audio).
When synthesizing audio from the short-time Fourier transform (STFT) sometimes you have unknown or noisy phase, and there’s an algorithm called Griffey-Lim that’s pretty common for finding the corresponding time-domain signal. You start in the STFT-domain and continually swap between time and STFT domains, each time fixing the STFT magnitudes. Eventually the phase tends to converge (but not sure if that’s guaranteed).
Maybe there’s something similar here where you keep swapping back and forth while applying the blue spectrum and uniform sample histogram constraints (or partially applying them in a gradient-descent fashion).
(Side note that there are other/better phase estimation algos for this problem, but Griffin-Lim is simple and relatively common)
You can think of it in terms of degrees of freedom. A real-valued length-N signal has N degrees of freedom. A length-N spectrum is complex-valued, meaning 2 degrees of freedom per frequency bin. When you constrain it to be conjugate-symmetric you bring the degrees of freedom back to N, which matches the real-valued signal.
Jitter is killer though - if the latency is randomly changing it's really annoying.
[1] https://bela.io/
You mentioned you were getting distortion/noise when downsampling below 928kHz. Are you lowpass-filtering before you decimate (but after you demodulate)? Otherwise you will get all kinds of aliasing.
Looks like FM radio stations have a bandwidth of 200kHz so you should be able to lowpass with a cutoff of around 50kHz then decimate to 232kHz.
This is a other great example, where speech is synthesized with an acoustic piano (though the keys are controlled digitally, the sound is just from the hammers and strings). Without the subtitles you probably couldn’t understand, but it sounds pretty clear when you know what it’s saying already.
One way to get high frequency resolution from the STFT or Wavelet transform is to use the phase derivative within each frequency band, which is usually called "instantaneous frequency", and is closely-related to the phase-vocoder (different from the daft-punk-famous vocoder).
The main issue with this kind of instantaneous phase estimate is that it assumes there's only one dominant frequency within each band - does your method improve on that?
I would say that the spectrogram is a visualization of the STFT magnitudes, in the same way that a line plot is a visualization of the FFT magnitudes. The STFT and FFT are both invertible though.
In both cases though it's possible to losslessly round-trip the audio within numerical precision (neither the STFT nor the Wavelet transform lose information).
#define V1(f) A f(w)A w;
#define V2(f) A f(a,w)A a,w;
Are much more quickly recognizable if you know that in APL the left and right arguments to a function are alpha (α) and omega (ω), so you'd immediately recognize these macros as for defining 1-argument and 2-argument functions.For folks in the know, conventions like this allow quicker communication and expression, but they also raise the barrier somewhat to the uninitiated.
Side note for folks used to "modern" (post 1989) C code - this is old K&R style function definition. This SO post (https://stackoverflow.com/a/3092074) shows a comparison.
Is there something about the primitives that APL-derivitives provide that mean that more of your program can happen inside the primitives so the interpreter is doing less work?
I'm also curious how the performance compares against something like Julia, which is JIT compiled so you avoid the distinction between the high-level and low-level code. Seems like a rather different region of the high-performance design space.
edit: also how does this relate to the "the whole interpreter fits in the cache" explanation that's also widely-invoked to explain K's speed? It seems like if you're spending most of your time in the primitives than the interpreter time doesn't matter. Maybe it's a combination of both - K and friends encourage you to organize your program in ways that support burning through data quickly, and additionally when the interpreter is operating it's a particularly fast interpreter?
Is this really what most implementations would do? I'd assume it would parse the expression `a+b+c` into a tree like
+
/ \
a +
/ \
b c
But then run a pass on the tree to identify expressions like this that could be fused together without creating intermediate results. I know that most APL implementations have more efficient implementations of certain idioms (commonly-used sequences of operators/functions), so I figured they must be doing something like this to be able to identify those idioms.This is just conjecture though, I'd love to know more about how this actually works in practice.
So I went to the library, browsed through several books to find one that seemed most relevant, and ended up checking out "Quaternions and Rotation Sequences" from J Kuipers. Having a single well-thought-out book that walked from the basic background all the way through, with consistent notation, was way easier to follow than the scattershot collection I'd found online.
So in general I'd say if you're optimizing for the most up-to-date information on a subject that's changing quickly, looking online is probably your best bet. If you want to learn something more foundational and can find a good book about it, I'd definitely go for that.
This person doesn't use their Apple ID for communication, because they have an Android phone. They probably purchased an iPhone for their child and set up the Apple ID using their email address. So to clarify, they weren't using their Apple ID with multiple devices, they just set up their child's Apple ID using their email address.
I'm not trying to slam Apple here, it's a complicated issue. I'm just saying that through a sequence of pretty reasonable steps we ended up in a situation where I was texting a colleague's daughter. Fortunately they were about parking my car, but it was pretty weird regardless.
edit: I guess they may use their Apple ID on their laptop as well, so it is on multiple devices. I just don't think they use it for iMessage.
I normally don't pay much attention to whether a message is being sent out over iMessage or SMS, and less technical folks probably pay even less, so it's a bad situation when those two methods end up going to different people.
That said, I'm actually not sure what the best behavior for iOS would be here - I get that they want to use the "best" transport and send over iMessage rather than SMS if it's available. Ideally there would be some kind of warning if the phone number I have in my contacts doesn't match the one on the device that's going to receive the message, but that seems finicky as well (what if I only have their land-line?).
I recently sent an iMessage and got a "who is this?" response. Turns out the message went to one of their family members.
I guess they shouldn't be sharing an Apple ID, but I don't think it's a super crazy thing to do among family members (e.g. a parent who provides a phone for their child), and having private text messages go to the wrong person seems like a pretty bad failure mode.