English Amiga Board


Go Back   English Amiga Board > Support > support.Hardware

 
 
Thread Tools
Old 16 July 2014, 12:31   #1
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,335
Converting between SuperCard Pro and Kryoflux raw/stream file formats

Is any software available to convert between the raw/stream file formats used by Kyroflux and SuperCard Pro?

If not, I'm hoping it wouldn't be impossibly hard to write my own converter...
mark_k is offline  
Old 17 July 2014, 12:18   #2
IFW
Moderator
 
IFW's Avatar
 
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
You are going to alias data that has already been aliased during sampling by each hardware... if you really want to do it, you need to do proper sampling conversion, like an audio software does, otherwise you introduce drifts and shifts that are not there in the first place in either original, unconverted data.
So if you are familiar with audio processing or dsp then it's not too difficult, if you are not, it's easy to do something that seems to work, but is incorrect and may render any later analysis unfeasible, due to cell jitter, peak shifts, compression etc introduced during conversion.

Last edited by IFW; 17 July 2014 at 12:30.
IFW is offline  
Old 17 July 2014, 12:25   #3
IFW
Moderator
 
IFW's Avatar
 
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
Ideally, you read and represent the samples in a very high numerical resolution reading the original data from any of the formats, then you resample to the selected target format.
This way you could avoid most of the artefacts introduced by anything simpler.
IFW is offline  
Old 20 July 2014, 12:13   #4
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,335
Ah okay. To avoid a complex not-entirely-lossless conversion process, would it be possible for a future version of the Kryoflux software (DTC?) to also support reading/processing .scp image files?

So if a Kryoflux owner obtains some .scp image files (of normal Amiga disks for this example), they could use DTC to convert them to ADF prior to writing back to a real floppy disk.
mark_k is offline  
Old 20 July 2014, 18:12   #5
JimDrew
Registered User
 
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 741
The HxC floppy emulator software can convert to/from SCP and KF image formats. No need to write anything, it's already done!

SCP can convert a .scp flux image into a .adf image. From there you can also use a variety of programs to write the adf back to a disk. I am testing the SCP's new .adf writing code right now. So, besides being able to go from disk->flux->adf, you will also be able to go adf->flux->disk. I assume you are just trying to write adf images back to disk?

Last edited by JimDrew; 20 July 2014 at 18:18.
JimDrew is offline  
Old 20 July 2014, 19:11   #6
IFW
Moderator
 
IFW's Avatar
 
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
I'll make note of this request.
IFW is offline  
Old 25 July 2014, 18:14   #7
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,335
Quote:
Originally Posted by JimDrew View Post
The HxC floppy emulator software can convert to/from SCP and KF image formats. No need to write anything, it's already done!
I didn't know about the HxC software, thanks for that! If its conversion is good/accurate enough, it should allow excellent interoperability between Kryoflux and Supercard Pro software/hardware. So (in theory) it should be possible to:
  • Dump a disk using SuperCard Pro (or download .scp file), convert to Kryoflux stream then analyse/process using Kryoflux software, or use with emulator which only supports IPF/Kryoflux images.
  • Download/dump disk in Kryoflux stream format, convert to .scp for analysis/processing using SCP software.
mark_k is offline  
Old 29 July 2014, 08:18   #8
JimDrew
Registered User
 
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 741
That is correct, however, keep in mind that when going from KryoFlux to SuperCard Pro format there will be a loss of resolution. SuperCard Pro samples flux at a 25ns resolution and KryoFlux samples flux at a 41.66ns resolution.
JimDrew is offline  
Old 30 July 2014, 06:19   #9
Supamax
Da Digger :)
 
Supamax's Avatar
 
Join Date: Nov 2008
Location: Monza, Italy
Posts: 2,822
Quote:
Originally Posted by JimDrew View Post
That is correct, however, keep in mind that when going from KryoFlux to SuperCard Pro format there will be a loss of resolution. SuperCard Pro samples flux at a 25ns resolution and KryoFlux samples flux at a 41.66ns resolution.
Converting from 41.66ns res. to 25ns res. leads to resolution loss? Not vice versa?

P.S. I asked this before but got no clear answers: where can these .scp images be found? Is there a repository or something? Thanks
Supamax is offline  
Old 30 July 2014, 08:25   #10
JimDrew
Registered User
 
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 741
Quote:
Originally Posted by Supamax View Post
Converting from 41.66ns res. to 25ns res. leads to resolution loss? Not vice versa?
Correct. Going from 41.66ns to 25ns is a loss. 41.66ns is ~24 samples per microsecond, and 25ns is 40 samples per microsecond. When you convert a lower resolution to higher resolution, you will have to do something to make up for the missing data, like averaging it.


Quote:
Originally Posted by Supamax View Post
P.S. I asked this before but got no clear answers: where can these .scp images be found? Is there a repository or something? Thanks
I am sure you won't get clear answers from anyone about this publicly if they are hosting copyrighted images. I know there are sites that exist, but I don't keep track of them.
JimDrew is offline  
Old 30 July 2014, 18:42   #11
demolition
Unregistered User
 
demolition's Avatar
 
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 43
Posts: 4,190
Quote:
Originally Posted by JimDrew View Post
Correct. Going from 41.66ns to 25ns is a loss. 41.66ns is ~24 samples per microsecond, and 25ns is 40 samples per microsecond. When you convert a lower resolution to higher resolution, you will have to do something to make up for the missing data, like averaging it.
Are both flux formats quantized to 2 steps?

If so, it will be hard to convert back and forth without issues. One time may work, but it will quickly deteriorate. If one of the two flux formats is analog (=a significant number of bits), it will be much better since much more information will be retained as you will also have timing information in the amplitude (if resampled properly). This timing information is thrown away when you quantize the output to 2 levels.

Notice that no matter how well it is done, resampling will always be lossy and converting back and forth several times will result in a successively degrading copy.
demolition is offline  
Old 31 July 2014, 01:43   #12
IFW
Moderator
 
IFW's Avatar
 
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
It is the timing between flux reversals that is being sampled by any of these devices, as that is the only thing you can access without modifying the drive hardware.
In other words, there is no amplitude information, it's all sampling an analog signal quantized to digital by the drive head filtering/AGC - that is the digital signal being timed by all of the devices. The quantization varies from drive to drive.
The sampling resolution simply refers to the aliasing factor in this case, not the number of samples taken per second. In other words, the time between two signals will be aliased to a multiple of whatever resolution is used for sampling plus the side effects of drive speed wobble etc.
There is absolutely nothing you can do about this, quite simply because you'd need a drive that was writing exactly at the same speed (to the nanosecond level) as is the drive you are using to sample the data as well as identical filtering circuitry... which is plain impossible due to how these drives work.
Any processing you do with the sampled digital data, such as resampling does introduce degradation, quality depending on how good the resampling you do is... but as you say each round trip would contribute to the loss of precision.
IFW is offline  
Old 31 July 2014, 01:51   #13
Supamax
Da Digger :)
 
Supamax's Avatar
 
Join Date: Nov 2008
Location: Monza, Italy
Posts: 2,822
Quote:
Originally Posted by JimDrew View Post
Correct. Going from 41.66ns to 25ns is a loss. 41.66ns is ~24 samples per microsecond, and 25ns is 40 samples per microsecond. When you convert a lower resolution to higher resolution, you will have to do something to make up for the missing data, like averaging it.
Thanks


Quote:
I am sure you won't get clear answers from anyone about this publicly if they are hosting copyrighted images. I know there are sites that exist, but I don't keep track of them.
Ok, but I would gladly welcome a PM regarding those sites/images from any mate here in EAB .
I really don't understand why:
- exchanging .adf files of copyrighted material: ALLOWED
- exchanging .scp files of copyrighted material: NOT ALLOWED

Copyrighted material is copyrighted material, regardless the media used.
Supamax is offline  
Old 31 July 2014, 01:57   #14
Supamax
Da Digger :)
 
Supamax's Avatar
 
Join Date: Nov 2008
Location: Monza, Italy
Posts: 2,822
Quote:
Originally Posted by demolition View Post
Are both flux formats quantized to 2 steps?

If so, it will be hard to convert back and forth without issues. One time may work, but it will quickly deteriorate. If one of the two flux formats is analog (=a significant number of bits), it will be much better since much more information will be retained as you will also have timing information in the amplitude (if resampled properly). This timing information is thrown away when you quantize the output to 2 levels.

Notice that no matter how well it is done, resampling will always be lossy and converting back and forth several times will result in a successively degrading copy.
Wouldn't it be easier (lossless) if both (SuperCard Pro and KryoFlux) sampled flux at the same resolution?
Supamax is offline  
Old 31 July 2014, 11:25   #15
IFW
Moderator
 
IFW's Avatar
 
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
The sampling is already lossy for any device of this kind, but the "loss" is aliasing exact timings to nearby timings. The drive speed wobble contributes as well, not to mention the quantizing done by the filtering circuitry in the drive...
So no matter what you do, it's lossy by nature, just like saying sampling any analog source - while what you sample is the timing of a digital signal, but the digital signal has been converted from analog by the drive first and is subject to small deviations. The only thing you change with the sampling resolution is that where "rounding" (aliasing) will occur, ie every Nth sample - but again, this will constantly change.
e.g. to demonstrate this, some random numbers:
10 10 11 10 10 10... vs 9 9 9 10 9 9...
Or think about plotting a graph, where fractions are aliased to integer values and depending on the result they fall into a specific value.
Another example is the jaggies in computer graphics, where you need anti-aliasing to compensate for the rounding because they cause visual artefacts - it's exactly same case as plotting graphs; you try to represent fractional values in a system where only integers are present.
Notice the word "represent" - that does not imply that your data is incorrect; the original data is correct, and can be easily reconstructed.
What does matter is that only the values alias, the sampling hardware itself does not - so the sum of timings stored in the samples are identical, where rounding happens and in what way is different.

As for resampling, you can get it very good, if done properly. Thinking about it a bit more, if done at sufficiently high resolution, in the first round of the conversion you'll get some timings moving a bit (think in nanoseconds...) then you'll get a slight oscillating effect for each round-trip, but essentially two fixed variants of the second generation data as long as the resampling algorithm is consistent. A good example of this would be RGB <> HSV conversion where the exact values first don't match, but after a second conversion they become stable - as long as the conversion is done at least in floating point resolution, but ideally higher...

We are talking about differences oscillating in the nanoseconds realm here, and to put this into perspective the data is represented in microseconds where 1us is 1000ns... and e.g. in MFM DD encoding (Amiga) the smallest valid flux reversal is 4us, ie 4000ns - so we are talking about a very small error here, a few ns vs 4000ns (min).
So unless it is some next to unreadable data where the different recording bands are almost bleeding into each other, the conversion should make no difference to the actual content. I must stress the point here: "if done properly"

Last edited by IFW; 31 July 2014 at 11:53.
IFW is offline  
Old 02 August 2014, 22:48   #16
demolition
Unregistered User
 
demolition's Avatar
 
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 43
Posts: 4,190
Quote:
Originally Posted by Supamax View Post
Wouldn't it be easier (lossless) if both (SuperCard Pro and KryoFlux) sampled flux at the same resolution?
Maybe, but if you can improve the sampling rate to create a better dump, shouldn't you? I think SCP is newer than Kryoflux, so it makes sense it would dump with a higher sampling rate. If only it was exactly double that of the Kryoflux, conversion would have been so much better.

Quote:
Originally Posted by IFW View Post
We are talking about differences oscillating in the nanoseconds realm here, and to put this into perspective the data is represented in microseconds where 1us is 1000ns... and e.g. in MFM DD encoding (Amiga) the smallest valid flux reversal is 4us, ie 4000ns - so we are talking about a very small error here, a few ns vs 4000ns (min).
When it is oversampled by that much, then a proper resampling shouldn't damage any data. It would be like resampling an audio signal and complaining about getting noise at 20 MHz. Who cares?
demolition is offline  
Old 03 August 2014, 06:53   #17
JimDrew
Registered User
 
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 741
I have found that any sampling faster than 20ns doesn't improve the image quality, but there is a significant differnce between 25ns and 50ns sampling.

I chose 25ns because the PIC is used runs at 160MHz internal to give 40 samples per microsecond. I made a new version with <15ns sample rate, but it was a waste so I kept it the same.
JimDrew is offline  
Old 03 August 2014, 06:57   #18
JimDrew
Registered User
 
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 741
Quote:
Originally Posted by Supamax View Post
Ok, but I would gladly welcome a PM regarding those sites/images from any mate here in EAB .
I really don't understand why:
- exchanging .adf files of copyrighted material: ALLOWED
- exchanging .scp files of copyrighted material: NOT ALLOWED

Copyrighted material is copyrighted material, regardless the media used.
You're right. Anyone posting copyrighted data without permission, regardless of the format it is in, is committing copyright infringement.

I don't keep track of these sites, because I don't want to know.
JimDrew is offline  
Old 03 August 2014, 16:24   #19
IFW
Moderator
 
IFW's Avatar
 
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
Quote:
Originally Posted by demolition View Post
When it is oversampled by that much, then a proper resampling shouldn't damage any data. It would be like resampling an audio signal and complaining about getting noise at 20 MHz. Who cares?
Yes, that pretty much sums up the effect you'd have with proper resampling
IFW is offline  
Old 03 August 2014, 18:06   #20
Arnie
R.I.P Smudge 18-08-16
 
Arnie's Avatar
 
Join Date: Aug 2005
Location: Leicester/UK
Age: 66
Posts: 3,968
Have I got this right, the op has Kryoflux (.raw) & SuperCardPro (.scp) images and wants to convert them to either format?

Why would you want to do that?
Arnie is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
[REQUEST] - KryoFlux RAW image support amigafreak68k support.FS-UAE 6 24 June 2014 07:48
SuperCard Pro disk recovery to ADF JimDrew News 9 11 April 2014 23:05
Supercard Pro Case kipper2k Hardware mods 4 25 March 2014 20:45
SuperCard Pro - Real disk images with WinUAE! JimDrew support.WinUAE 72 22 March 2014 09:12
KryoFlux: STREAM file format documentation mr.vince project.SPS (was CAPS) 1 26 May 2011 00:40

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:05.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.12460 seconds with 13 queries