Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 09:42 26 Apr 2024 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 : CMM2: V5.07.00RC1 - Getting closer :-)

     Page 4 of 4    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 10:46am 17 Jun 2021
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Have you been able to discover what is wrong with the FFT ?


Next on the list.

Please provide a text file with 1024 sample values to use as input (1 per line)  together with what you think are the correct FFT real and imaginary values


If it isn't overstepping the mark then given these values I don't mind adding this to my unit-test suite which should help to reduce the possibility of future regression.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3521
Posted: 10:57am 17 Jun 2021
Copy link to clipboard 
Print this post

Hi Peter,

Please find attached excel file. The data in the yellow column is data from the picomite using a hann window over a 10 cycle sine wave.

fft_in_excel.zip

The blue column is the complex FFT that excel calculates from this data.
The red column is the magnitude calculated from the complex FFT data.

I did not invent this myself, this was from a web tutorial. You have to install the excel data analysis package to re-run the excel FFT.

I hope this helps.

Volhout

P.S. on the web they suggest you can verify a complex FFT (IM/RE in and IM/RE out) by running it again using the FFT output as input. You should get the original input back with only rounding noise. Not sure how this works on a real FFT. A real FFT inputs only RE data, but has speed optimizations to avoid needles calculation with IM data that is zero anyway. Not sure what you implemented ? A real FFT, or a complex FFT where you zero the IM array at start.
Edited 2021-06-17 21:03 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3521
Posted: 11:51am 17 Jun 2021
Copy link to clipboard 
Print this post

Some additional information:

I have written the complex FFT in basic on the pi-pico, and when I run that code on the hann windowed 10 sine wave input signal, I get the same response at EXCEL.



This means that the problem is not in the input data.
The fft basic code:



Array a!() contains the real input values.

Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 12:33pm 17 Jun 2021
Copy link to clipboard 
Print this post

  Quote  The red column is the magnitude calculated from the complex FFT data.


The magnitude in the spreadsheet doesn't make sense unless I'm missing something as usual. Look at line 12 of the spreadsheet. Shouldn't the magnitude be something bigger than 255? sqrt(255.6^2 + 7.8^2)
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3521
Posted: 12:57pm 17 Jun 2021
Copy link to clipboard 
Print this post

Hi Peter,

You are right. That is what happens when you simply copy what is on the internet, and don't check every step.



There is a multiplication with 2/64 (divide by 32). No idea why. Maybe to tune the values into a certain range (0..8) ....

Sorry for the confusion ...

Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 01:06pm 17 Jun 2021
Copy link to clipboard 
Print this post

Good - in that case I think I've fixed it

Try the attached on the CMM2


CMM2.zip

and if OK I'll do a full release and move the changes to the other platforms
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3521
Posted: 07:15pm 17 Jun 2021
Copy link to clipboard 
Print this post

@Peter,

YEESSSSSS, that is it. An immediately the immense resolution of the 64bit variables shows. As a technician I am truely impressed. May I ask what caused it ?

Here some proof (an showing the effect of windowing the input data).

Raw data (as if from an ADC)



The FFT window shows data on logaritmic scale, so be impressed, even with the raw data. In linear mode it only shows a peak and then a flat line at 0.

Data with Hann window. The peak is the sine frequency, you can see that the spurious are far below -140dB (if you check the data there is even -680dB, that is beyond the measurement range of anything I know. Not even the super cooled Hubbel telescope get's even near. Anyway, this is definitely compatible with 24bit ADC's, and won't degrade the performance in any way.



Thank you for fixing this.

Regards,

Volhout.

P.S. I have clamped the data inside the FFT window, I noticed that when I exceed the window (by far...the -680dB) the program stalled (would not respond to the "input a$" statement that handles my user interface anymore) but could be stopped with <CTRL-C>. Could be my code. so don't worry....
Edited 2021-06-18 05:19 by Volhout
PicomiteVGA PETSCII ROBOTS
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1082
Posted: 09:20pm 17 Jun 2021
Copy link to clipboard 
Print this post

> list
mode 1,8
page write 0
cls rgb(grey)

page resize 1,500,500
page write 1
line 0,0,800,600
page copy 1,0,B
end

> run
Error in line 12: Page size mismatch - use BLIT

No surprise with the error. However, the BLIT command doesn't respect vertical blank timing and can result in tearing. Is GETSCANLINE the only solution?

As an alternative, could the PAGE COPY command have two optional parameters specifying the top left corner of the destination? The key is that the ,B and ,D parameters work.
Visit Vegipete's *Mite Library for cool programs.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 09:55pm 17 Jun 2021
Copy link to clipboard 
Print this post

  Quote  Is GETSCANLINE the only solution?


You can also use the frame blanking interrupt set up in the mode command
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 08:16pm 19 Jun 2021
Copy link to clipboard 
Print this post

Hi Peter,

I've smoke tested "The Welcome Tape" on the RC4 build including FFT fix from this post and it all looks good.

For sake of completeness I've got three observations that probably amount to nothing and certainly don't provide sufficient information to act upon:

1. When switching MODE the duration for which the screen is blanked seems highly variable even for performing the same transition multiple times - this may be an artifact of my video capture device.

2. On one occasion since the update to RC4 I saw some sort of memory error message but failed to capture the exact text or circumstances and haven't seen it since.

3. On another occasion trying to run a program using the * shortcut I got the "Could not find the file" error message the first time, and then it ran successfully when I repeated the command.

I will of course keep my eyes peeled and get back to you if I find anything more tangible.

Best wishes,

Tom
Edited 2021-06-20 06:17 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
MauroXavier
Guru

Joined: 06/03/2016
Location: Brazil
Posts: 303
Posted: 10:54am 21 Jun 2021
Copy link to clipboard 
Print this post

The MEMORY command hangs my CMM2.

Sometimes in normal operation, sometimes with the OPTION BASELINE ON.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 11:23am 21 Jun 2021
Copy link to clipboard 
Print this post

  MauroXavier said  The MEMORY command hangs my CMM2.

Sometimes in normal operation, sometimes with the OPTION BASELINE ON.


For what it's worth I can't reproduce that on my 400 MHz Waveshare CMM2 with the following settings (and also with OPTION BASELINE OFF):

400MHz Colour Maximite 2
MMBasic Version 5.07.00RC4
Copyright 2011-2021 Geoff Graham
Copyright 2016-2021 Peter Mather

> option list
CURRENT VGA mode 800x600 RGB332
CURRENT DISPLAY 50,100
OPTION USBKEYBOARD UK, 1
OPTION BASELINE ON
OPTION RAM ON
OPTION KEYBOARD REPEAT 200,50
OPTION SEARCH PATH /bin/
OPTION F11 chdir "/zmim/src"<crlf>
OPTION F12 chdir "/sptools/src"<crlf>


Have you run anything in particular beforehand (which I can try) or does this issue exist from boot ?

Best wishes,

Tom
Edited 2021-06-21 21:35 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 02:21pm 21 Jun 2021
Copy link to clipboard 
Print this post

New reproducible bug ... was in two minds whether to report given the weird example, but it might be a canary for a bigger problem:

> edit "foo.bas"
Enter:
Print "Hello"
CSub foo
End CSub
Run via F2
Error in line 3: Invalid hex word <-- expected
> edit
Run via F2
Memory write address <-- unexpected


Best wishes,

Tom
Edited 2021-06-22 00:22 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 03:02pm 21 Jun 2021
Copy link to clipboard 
Print this post

Its not a bug, you just don't like the error messages. The Csub is empty which is always invalid. In the first case this is picked up by the program load in the second the program is already loaded and it is picked up by the pre-processor. Not something that merits looking at.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 03:07pm 21 Jun 2021
Copy link to clipboard 
Print this post

  matherp said  Its not a bug, you just don't like the error messages. The Csub is empty which is always invalid. In the first case this is picked up by the program load in the second the program is already loaded and it is picked up by the pre-processor. Not something that merits looking at.


OK, note that in the 2nd case it also clears the current program, i.e. after the first error typing EDIT will open the program, but after the second typing EDIT will report "Nothing to edit".

I'm not saying any of this matters to me, I'm just providing information on which decisions about expected/intended behaviour can be made.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 08:23pm 01 Jul 2021
Copy link to clipboard 
Print this post

Sorry to ask again, but is V5.07 ready for release now. I'd love an up to date manual.

Bill
Keep safe. Live long and prosper.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5725
Posted: 09:02pm 01 Jul 2021
Copy link to clipboard 
Print this post

It'll appear on Geoff's page when it's ready, I suspect. He's only showing 5.06 at the moment, although there might be a newer beta release. I wouldn't count on there being an updated manual yet.
Mick

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

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1593
Posted: 09:11pm 01 Jul 2021
Copy link to clipboard 
Print this post

Yes Mick, it appears that all 'known bugs' have been fixed in the latest beta and Peter seems to be putting all of his efforts into the 'next big thing' so I just hoped that it might be time to officially release the latest version.

Bill
Keep safe. Live long and prosper.
 
     Page 4 of 4    
Print this page


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

© JAQ Software 2024