Jump to content

Wikipedia:Reference desk/Archives/Miscellaneous/2024 May 20

From Wikipedia, the free encyclopedia
Miscellaneous desk
< May 19 << Apr | May | Jun >> May 21 >
Welcome to the Wikipedia Miscellaneous Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


May 20

[edit]

usefulness of complex-input FFTs in audio spectral analysis

[edit]

Since I've implemented a feature to treat stereo audio as complex numbers in one of my own audio spectrum analyzer projects over CodePen, I'm curious about whether or not is there any useful cases of complex-input FFTs as in the case of I/Q signals on any SDR-related stuff, being performed in typical two-channel audio? BTW, I'm not talking about the performance benefits of using one complex-input FFT to visualize two spectrums for each channel, which is the same, plus the "unscrambling" operation to make it look like individual FFTs of each channels. 2001:448A:3070:DF54:98E8:4EDF:605:8379 (talk) 00:59, 20 May 2024 (UTC)[reply]

The Discrete Fourier transform (DFT) that converts a sequence of data samples to a set of complex coefficients of frequencies is directly applicable for spectral analysis. The frequency domain representation of the input sequence allows many useful signal processes, including frequency-selective filters, and the filtered frequency coefficients can be converted back to real data by means of an Inverse DFT.
Mathematically a DFT converts a sequence of N complex numbers into another sequence of complex numbers, which is defined by:
Discrete Fourier transform
The operation is computationally intensive as N must be large enough for a required frequency resolution but it can be speeded by the digital FFT (Fast Fourier transform) algorithm. A further simplification is that for a real signal such as audio from one microphone, only real values of need be processed i.e. the imaginary value of each sample can be zero. Such real-data-in, complex-values-out usage of FFTs is commonplace. However it is useful to note that the zeroed imaginary data points potentially offer themselves as a second, independant data stream. The OP cites a .pdf that correctly demonstrates that two stereo audio signals can be combined as real and complex inputs to a single FFT. That one FFT can process two signals without interference is demonstrable by recovering the signal samples in an IDFT thus:
Inverse transform
While the economy of using a single FFT to process both stereo channels is obvious it is less obvious that any two real input data streams may be applied as there really is no interference between them. Noting that the algorithms for forward and inverse DFTs are similar, a system programmer will usually write code that is reusable for both and has provision for complex input data, even if that is superfluous for the DFT, because it is always demanded for IDFT. Apart from audio applications, an IDFT/DFT pair is useful as digital Codec in digital carrier Phase-shift keying modulations BPSK (real values) and QPSK (complex values). Philvoids (talk) 19:58, 20 May 2024 (UTC)[reply]
@Philvoids Thanks for a lengthy explanation but what I meant by "complex-input FFTs" as in this CodePen project is simply treating stereo pairs or even Mid/Side representations as complex numbers and do no postprocessing at all and simply display two graphs with different colors; the first one is as usual as regular FFT spectrum, and the second graph is exactly the same but the ordering of FFT bins is reversed since we provided an FFT a complex-valued input, the output is no longer conjugate-symmetric, which could display stereo FFT in a different way (one graph is higher in amplitude than other means being closer to 90° out-of-phase, either clockwise or counterclockwise) and might have practical uses or is it? 114.5.253.252 (talk) 18:50, 21 May 2024 (UTC)[reply]
While agreeing that a single FFT can treat samples of a stereo pair as complex numbers, I have not found more useful references than those already given for your on-going project; it feels more like a "solution looking for a problem" than a "problem looking for a solution"! We also cannot speculate or know whether your interest is theoretical curiosity or you have an application or product plan. Philvoids (talk) 03:04, 22 May 2024 (UTC)[reply]
I agree with @Philvoids and this DSP related thread about the same topic in regards of treating stereo sample as complex numbers, I'm just curious why people bringing up some performance improvements of stereo FFT by treating an input as complex numbers for a single FFT and doing "unscrambling" operation afterwards instead of other niche stuffs using same FFT as for I/Q radio signals but for audio? Sure, it could identify TSAC-encoded music with the same complex-input FFTs as for I/Q signals as "holes" in one (red) graph at higher frequencies (around 15kHz) as in this image on this HA thread about the same topic. 114.5.249.110 (talk) 21:40, 22 May 2024 (UTC)[reply]

Calendar change and historical procrastination

[edit]

Initially, only a few countries already switched to the Gregorian calendar in 1582. But then, as the centuries go by, more and more countries followed the calendar change, including Great Britain in 1752. This continued all the way until the year 1923 in Greece.

So, could such a long waiting be considered as a kind of procrastination? Procrastination means putting off tasks to a later date, and the task relevant to this question is that of switching to the Gregorian calendar. One of the negative consequences is that the longer you waited, the more days you had to drop from the Julian calendar. Changes in the 1500s, 1600s, 1700s, 1800s, and 1900s required 10, 10, 11, 12, and 13 days to be dropped, respectively (note that 1600 was a leap year in both calendars, so no additional day needs to be dropped until 1700).

GTrang (talk) 16:21, 20 May 2024 (UTC)[reply]

It could depend on each country's rationale for resisting. One possibility could be anti-Catholic bias. ←Baseball Bugs What's up, Doc? carrots18:03, 20 May 2024 (UTC)[reply]
Specifically, the head honchos of the Eastern Orthodox Churches felt that adopting this calendar proclaimed by a papal bull would be seen as admitting the supreme authority of the head honcho of the Roman Church.  --Lambiam 19:21, 20 May 2024 (UTC)[reply]
We must be patient. An agreement on the term honcho picked up 1947-1953 by U.S. servicemen from Japanese hancho "group leader" has still not been reached in catholic churches since the East–West Schism of 1054. Philvoids (talk) 21:01, 20 May 2024 (UTC)[reply]
This is a little off-topic, but does anyone understand why they didn't just say, OK, we're changing the schedule of leap years going forward, but we're not dropping any days from the current calendar? It's weird to me that they preferred to set the correlation between seasons and the calendar to something it hadn't been in living memory. I could maybe understand if it were a date-of-Easter thing, but Easter has never gone by the solar calendar anyway, so that also doesn't make sense. --Trovatore (talk) 19:32, 20 May 2024 (UTC)[reply]
325AD was important, Christmas (second most important after Easter) is solar and Easter falling up to 7+30 or 7+29 days later than the Sunday after the first spring Full Moon and up to ~10 days later in spring than could in 325 made them feel icky. Sagittarian Milky Way (talk) 00:45, 21 May 2024 (UTC)[reply]
On a smaller scale, we have the 19-second difference between GPS time and International Atomic Time, and the running difference between those and Coordinated Universal Time, occasioned by one of the worst ideas in the history of human timekeeping. When they finally get rid of the stupid thing and treat the pose of the Earth as just another ephemeris, like they should have done for at least fifty years, it will be interesting to see whether they attempt some unification, or just have three separate clocks with a fixed difference of a few seconds. --Trovatore (talk) 19:43, 20 May 2024 (UTC) [reply]

That would be a sin and make astronomers and some sailors feel icky. Astronomers deal with way more than three clocks per location and the 70 second difference from the endlessly slowing spin crossing 24 SI hours in like 1820 all the time, suck it up programmers. Sagittarian Milky Way (talk) 00:45, 21 May 2024 (UTC)[reply]
It's the astronomers who need to suck it up and treat the Earth's pose as just another ephemeris. --Trovatore (talk) 00:49, 21 May 2024 (UTC)[reply]
The astronomers have to do that anyway, because leap seconds only get you to the nearest second or so, and that is often not good enough. The UT1-UTC ephemeris can be predicted pretty well into the future, except for leap seconds. Leap seconds throw it off completely because they are a political decision and cannot be reliably predicted beforehand. They also introduce a discontinuity so that you have to be careful when interpolating. [1] So getting rid of leap seconds would probably make it easier for the astronomers. (It might still be true that it would also make them feel icky.) —Amble (talk) 02:46, 21 May 2024 (UTC)[reply]
According to the linked article, the current plan after leap seconds are ended by 2035 is either for a leap minute or leap hour in the future, so I'm not sure it makes sense to unify them when they're going to drift again in the future. I mean it would be slightly cleaner since whatever they chose future changes would be in that whole number and so the difference would always be in that number of units. OTOH, it doesn't seem like that number is that significant for most purposes, so I wonder if they will care. Also I wonder if the more likely plan if it's decided to keep the difference in whole units, might be for the first "leap minute" or "leap hour" to actually be slightly less or more than an actual minute or hour and use that to hit on a whole number of unit. Note that there's some suggestion that a negative leap second may be coming perhaps before 2035 and so that may need to be dealt with either by eliminating leap seconds sooner, or simply skipping it even if it's technically required under the current system; rather than risk finding out what software bugs may exist for something which won't be needed for much longer [2] (although assuming the leap minute or leap hour ideas go ahead, it's theoretically possible they would need it). Nil Einne (talk) 11:06, 22 May 2024 (UTC)[reply]
BTW, do astronomers really have much to do with it? While not well discussed, from what is discussed and common sense I think the bigger issue may be the desire of some countries for UTC to be fairly tied to TAI but also have 1200 in their local time zone (which is tied to UTC) be roughly midday (depending on their local timezones) rather then for it to potentially be midnight sometime in the distance future. (Well that's a fairly distant thing, but it sounds like some are even unhappy with it diverging by even an hour.) The counter argument that there is already so much variance given the spread of timezones etc seems to have won out for the leap minute or maybe even the leap hour. But as this time, I think they're still unhappy with the eventual possibility it could indeed be midnight during 1200 in the future. Nil Einne (talk) 11:19, 22 May 2024 (UTC)[reply]
Any large discrepancies would be way in the future, and barring enormous advances in life extension, are not going to affect us. Anyone they will affect would be born in a world in which it's not that different, so they'll have plenty of time to get used to it.
Without leap seconds, a person who lives 120 years will see nominal average sunset times shift by, what, 90 seconds or something? Come on, there's no way this is seriously a problem. Leap seconds are just a really really bad idea, and hopefully they'll expunge them with all deliberate speed. --Trovatore (talk) 18:53, 22 May 2024 (UTC)[reply]
Anyone so irritated by leap seconds needs to use GPS time or an International Standard Computing Time that equals UTC at the conference creating the standard or maybe TAI. If done soon that would give many, many months to reprogram before the next leap second (Earth's recently been spinning close to the UTC accumulation and unusually close to the SI rate based on human knowledge right before the slowdown was first measured which was based on 18th and 19th century position measurements). Computers already convert UTC to time zone, just use atomic time and leave UTC alone. Also we have to make time impure for all time cause idiots didn't change Unix time to the actual number of SI seconds by the 1990s when computer clocks became accurate enough or 2001 when they made 2100 a leap year? Leap seconds are perfect! Pure unsmeared SI seconds except 1 second every few years on average (6 months happened once) and it can't more than 0.9 seconds wrong. Also you do know it's quadratic right? People shouldn't be boiled to wrongness they wouldn't accept all at once in the same lifetime like the leap hour in 2600 (fucking night owls' sleep by making 8am earlier in the day till it happens. New York Cityans who could wake up 11.5+ hours after sunset and 0.5+ hours after sunrise without risking lateness would have to wake up ≤11 hours after sunset and (c. Jan 4 and Nov 5-6 DST) at sunrise or before like a weirdo morning person). If I didn't grow up in it I'd think daylight savings is an abomination instead of mixed feelings more pro than con (DST also fucks sleep but I never knew anything else). Sagittarian Milky Way (talk) 22:00, 22 May 2024 (UTC)[reply]
Time is time; the Earth moves somewhat irregularly with time. There is no reason our timekeeping needs to follow the Earth's foibles.
Just freeze the current difference between UTC and TAI now and forever, and then we can keep using UTC. Sure, our great-to-the-nth grandchildren may be getting up at 3 AM or 3 PM or whatever, and they'll think the name "midnight" is kinda weird and that time references in old literature don't make a lot of sense, until someone remembers that it's drifted since then. Of course human schedules will adjust to move with the Sun, not with the clocks.
So what? It's a little like the scene in It's a Wonderful Life where George Bailey is offered the amazing salary of $25,000 per year, beyond dreams of avarice, and is briefly tempted. You can watch that and understand it; even if you don't know just how much that would buy you, you understand it's a lot. --Trovatore (talk) 22:15, 22 May 2024 (UTC)[reply]
9 to 5 has never been 10 to 6 or 11 to 7 in double war time, it'd reach insanely discriminatory levels before it'd be 10 to 6! Schools discriminate against teens, industry lobbyists discriminate against night owls (the theater, nightlife etc lobbies are collectively weaker than the golf, bike etc lobbies). We expanded DST as much as we could (Nov 6 very competitive with latest post-Nov day in sunrise lateness at 40N near the meridian), we're used to it, it delays ugly June dawn, there's no room for more. Enough circadian rhythm bigotry. Sagittarian Milky Way (talk) 04:51, 23 May 2024 (UTC)[reply]
Delays the June dawn? Nonsense. The dawn is when it was always going to be. We're just putting a different number to it. You don't have to let that number control when you do things; it's just a number, not a cop.
Now, granted, sometimes you have constraints based on when other people want to do things. But again, there's no need for them to schedule them according to any particular time coordinate. If you don't like when they want to do it, well, push back!
I'm reminded of when I had a summer job working for IBM in Tucson. We had some flexibility in our hours, but the people I was riding with wanted to do the 7:00 AM to 3:42 PM schedule (IYKYK on the 42 minutes). Insane, right?
Not so much. Arizona doesn't observe DST, so that's 7:00 AM Mountain Standard Time, which would be 8 if they observed DST. Also, Tucson is further east in its time zone than Los Angeles, so you can think of it as 8:30.oops, got that bit wrong. Still early for my taste, but not totally unreasonable.
Similarly, the Spanish famously do everything late. But do they? Madrid is west of London, but shares a time zone with Vienna. By the Sun, they're...still pretty late, but not quite as much as you might think.
The point is that human schedules are a self-organizing system, not under central control, and respond to what you might call "market forces", which in the long run will optimize them to the position of the Sun, not to a number on the clock. --Trovatore (talk) 06:23, 23 May 2024 (UTC)[reply]
Yes you don't have to be an astronomer or sextant user to have a desire for SI seconds with an extra second announced in advance to keep it approximately the closest second, it's unsurprising if pro-leap second astronomers and sextant users outnumbered by other pro-leap second humans through sheer numbers. Midnight at 1200 is insane, that's 12 hours wrong even Anchorage doesn't use California time for convenience (2 hours wrong) and they're used to it never getting dark then just a few hours of day. If the south horizon's high enough the city doesn't touch sunlight for weeks and the north horizon's only lit a few hours. Leap minutes would be an unneeded complication increasing the number of things that can't use civil time without extra work fixing it back to mean solar time of the multiple of 15 longitude. For instance Earth spins 11.7 longitude seconds in 0.78 time seconds (eyeballing the most it's been wrong so far on a graph, though they stopped jumping the gun so much over time so it doesn't get that bad anymore, probably they could not pad it at all without risk of it speeding from a 6 month forescast of c. 0.5 seconds to over their 0.9 second mandate in only 6 months). It would hardly affect sextant accuracy to use British Standard Time or Iceland Time (they're UTC all year), if it was leap minute even if it switched at 30 instead of 60 that'd be 7.5 minutes wrong (up to almost 9 land miles/14km). That's as inaccurate enough to put a very low island beyond the horizon from up to tens of yards up, several times the horizon distance of standing on a perfectly flat Earth and not even close to a passing score for sextants, eagle-eyed Tycho Brahe did 14 times better in the 1500s with just a 1.6 meter wood and his eyeballs. Sagittarian Milky Way (talk) 15:06, 22 May 2024 (UTC)[reply]
The non-computerized sextant user already has to carry charts based on the date and latitude and such, right? Let him keep one more table, which is the number of seconds to add or subtract in a given year. It doesn't change that much so he can probably just remember one extra number and it'll be good for some time. Problem solved. --Trovatore (talk) 19:44, 22 May 2024 (UTC)[reply]
Stop using UTC for computers. Problem solved. Or maybe leap seconds could be abolished and the second could be changed once it's crossed 0.6 seconds, to the value estimated to keep it less than 0.6 seconds wrong the longest. Would that be that bad? The scientists who need to specify this second is 86,400.002/86,400.000ths the early 2020s second probably have complex work already. Sagittarian Milky Way (talk) 22:15, 22 May 2024 (UTC)[reply]
And pre-electric navigating tools will survive solar and military electromagnetic pulses that would melt all metal too many kilometers long and probably fuck all navigation that needs electricity. They'd survive an anti-satellite or computer virus war. Sagittarian Milky Way (talk) 22:31, 22 May 2024 (UTC)[reply]
If you want to avoid leap seconds, but keep the local time in sync with the sun, you can just periodically shift all the time zone boundaries. Instead of a leap second, you’d shift the boundaries by 15 arc-seconds of longitude, which is about 300 m at the equator. You can call them leap-meters. I suspect this idea will not catch on. —Amble (talk) 15:52, 22 May 2024 (UTC)[reply]
That would decouple time zones from longitudes that are multiples of 15 and no one would want to move the line till most of a metro area or at least rural county has passed through it. Sagittarian Milky Way (talk) 22:38, 22 May 2024 (UTC)[reply]
The biggest headache from leap seconds is that they are incorporated into things like Unix time / posix time that really ought to be a continuous count, or at least monotonic. At a leap second, the same timestamp gets replayed and no longer corresponds to a unique moment in time. Whatever we end up doing with leap seconds, leap minutes, and leap hours, all of the not-quite-continuous-count time coordinates need to be banished ASAP. Then you’d only need to worry about leap seconds when converting a single, continuous time coordinate into a formatted local time. —Amble (talk) 15:52, 22 May 2024 (UTC)[reply]
Stop using UTC for things where monotonicity is important and leave UTC as it is. Sagittarian Milky Way (talk) 22:38, 22 May 2024 (UTC)[reply]
Sweden maximized the inconvenience by procrastinating several times in different directions: Swedish calendar. First they decided that the big jump was too much to do all at once, so not to switch all at once, so they spread it out over the course of several decades, by simply skipping leap years. Then they got distracted and forgot to forget some of the leap years. Then they decided the whole thing was a lot of trouble, and switched back to the Julian calendar by observing a double-leap-year, which had a February 30. Not too many decades after that, Sweden finally switched to the Gregorian calendar in the usual way, by skipping a block of days all at once. Some of these decisions have got to be worse decisions than leap seconds... —Amble (talk) 20:28, 20 May 2024 (UTC)[reply]
I did say "one of the worst". --Trovatore (talk) 20:38, 20 May 2024 (UTC) [reply]
That’s fair! In the history of timekeeping there have been enough questionable decisions that it would be difficult to pick just one. —Amble (talk) 00:18, 21 May 2024 (UTC)[reply]
The advantage of stopped clocks is that they are right twice a day in all systems of timekeeping.  --Lambiam 08:38, 21 May 2024 (UTC)[reply]
I feel like you're missing a pretty obvious counterexample. --Trovatore (talk) 20:19, 21 May 2024 (UTC) [reply]
A clock running backward is even better! —Tamfang (talk) 22:34, 21 May 2024 (UTC)[reply]
I wonder why no state did it by dropping each 31 for a couple of years. —Tamfang (talk) 22:35, 21 May 2024 (UTC)[reply]
That would have put them into an analogous situation that Sweden faced. In those intervening years they would have been out of synch with both the Julian and the Gregorian, and thus out of synch with every country in the world that uses any version of the Western calendar. Hopeless confusion would have ensued. Referring to those dates in later years would have required a tripartite code: Old Style, New Style, and Our Special Temporary Style. Life's too short for that sort of shit. -- Jack of Oz [pleasantries] 22:58, 21 May 2024 (UTC)[reply]

Internet Archive

[edit]

When archiving web pages with an option to switch between metric and imperial units, in many times the imperial units come to the archived version. Why does this happen? It may occur when the menus have imperial option in just one place. Which is the reason for that? --40bus (talk) 19:47, 20 May 2024 (UTC)[reply]

The archiving service loads the page from the web, not from your browser. It does not know what cookies you have set.  --Lambiam 08:23, 21 May 2024 (UTC)[reply]