Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:08 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Has anyone written an audio spectrum analyzer in MMBasic?

Author Message
al18
Senior Member

Joined: 06/07/2019
Location: United States
Posts: 228
Posted: 07:24pm 04 Mar 2022
Copy link to clipboard 
Print this post

I saw this post/video about an audio spectrum analyzer for the Color Computer and was wondering if anyone has written one in MMBasic https://sonicstate.com/news/2021/10/19/a-1981-computer-spectrum-analyser/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SonicstatecomNews+%28Sonicstate.com+News%29
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 09:38pm 04 Mar 2022
Copy link to clipboard 
Print this post

That's rather nice! As far as I know no-one has done anything like that in MMBasic - possibly because none of the platforms support cassette save & load so there's no audio input.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1593
Posted: 10:14pm 04 Mar 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  ... - possibly because none of the platforms support cassette save & load so there's no audio input.

I think a good substitute might be an analog input?
Kind regards
Michael
causality ≠ correlation ≠ coincidence
 
al18
Senior Member

Joined: 06/07/2019
Location: United States
Posts: 228
Posted: 10:25pm 04 Mar 2022
Copy link to clipboard 
Print this post

On YouTube Dave's Garage channel from yesterday titled Building the C64 Audio Spectrum Analyzer shows a C64 displaying the spectrum analyzer. The hard work of running a FFT for 16 channels is actually done by an ESP32 and the data is sent via serial port to the C64.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 10:35pm 04 Mar 2022
Copy link to clipboard 
Print this post

  twofingers said  
  Mixtel90 said  ... - possibly because none of the platforms support cassette save & load so there's no audio input.

I think a good substitute might be an analog input?
Kind regards
Michael
This is true...  
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 10:37pm 04 Mar 2022
Copy link to clipboard 
Print this post

Depending on the device your are interested i using, FFT is your friend


VK7JH
MMedit
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 10:49pm 04 Mar 2022
Copy link to clipboard 
Print this post

I never got my head round FFT. As far as I'm concerned it's a form of Magik.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 12:00am 05 Mar 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  I never got my head round FFT. As far as I'm concerned it's a form of Magik.

It sort of is...

But... it turns out mathematically (*) you can represent any waveform as a sum of sine (or cosine) waves. Doesn't seem exciting but there's lots of maths that is applicable to such.

You can transform and then untransform (take the inverse) to get back but in the middle do things like remove frequencies that must be noise.

Now, theoretically an infinite sum of sines may be needed, but in practice we don't measure data (signals) exactly so short-cuts can be used (smaller numbers of sines, for example).

It's actually fun (I'm a geek) to approximate a waveform (say a square wave) with a sine wave, then add in another, and so on, watching the result go from a sine to nearly a square wave.

You have to use different sizes (amplitudes) of sines.

(*) Fourier tends to get the credit

FFT is just a fast version of the original (FT) idea.

I'm skipping all the complicated clever stuff!

John
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 01:29am 05 Mar 2022
Copy link to clipboard 
Print this post

404 not found error for me...
Smoke makes things work. When the smoke gets out, it stops!
 
al18
Senior Member

Joined: 06/07/2019
Location: United States
Posts: 228
Posted: 01:51am 05 Mar 2022
Copy link to clipboard 
Print this post

To find the video, just Google adrian's digital basement audio spectrum analyzer
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 07:44am 05 Mar 2022
Copy link to clipboard 
Print this post

I did a simple copy/paste of the entire link into a browser search bar. It wouldn't work as an actual link.

Thanks John. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025