This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyPDF2 import PdfFileMerger | |
from svglib.svglib import svg2rlg | |
from reportlab.graphics import renderPDF | |
def svgs_to_pdf(file_paths=[r'C:\1.svg',r'C:\2.svg',r'C:\3.svg'], output_folder='tmp', pdf_name='test.pdf'): | |
""" | |
Convert svg files into pdfs, save pdfs in output_folder, merge them in one pdf file. | |
@param file_paths: full paths to svg files | |
@param output_folder: path to folder for saving temporary pdfs | |
@param pdf_name: name for resulting pdf file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import soundfile as sf | |
from scipy.fftpack import fft, ifft | |
def rotateSignal(signal,flip): | |
if flip: | |
signal = signal[::-1] | |
x = np.concatenate((signal, signal[1:][::-1])) # concatenating the array with a reverse of itself makes it such that the fourier transform doesn't layer over a reversed version of itself in the inverse fft | |
rotSig = ifft(x) |