// // main.swift // WaterfallFile // // Created by Jacky Jack on 23/12/2024. // import Foundation import Accelerate print("Read binary file") let input_filename="rtlsdr_100M_m.cu8" //get data from u8 file let dir = getCurrentExecutableDir() let filemgr = FileManager.default if !filemgr.fileExists(atPath: input_filename) { print("Cant find file \(input_filename)") exit(0) } let fileHandle: FileHandle? = FileHandle(forReadingAtPath: dir+"/"+input_filename) var i8_arr:[Int8]? = nil if let file = fileHandle { file.seek(toFileOffset: 0) do { if let databuf = try file.readToEnd() { print("read \(databuf.count) \(databuf) bytes") //let temp_arr = [Int8](databuf) i8_arr = [Int8](repeating: 0, count: databuf.count) for i in 0..