From a24c6b842d982de8a38ae5058ace91cb47ee3cef Mon Sep 17 00:00:00 2001 From: Pete Warden Date: Wed, 5 Apr 2017 17:10:48 -0800 Subject: Add AudioSpectrogram op to TensorFlow for audio feature generation Change: 152332221 --- third_party/fft2d/BUILD | 30 ++++++++++++++++++++++++++++++ third_party/fft2d/LICENSE | 3 +++ third_party/fft2d/fft.h | 36 ++++++++++++++++++++++++++++++++++++ third_party/fft2d/fft2d.BUILD | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 third_party/fft2d/BUILD create mode 100644 third_party/fft2d/LICENSE create mode 100644 third_party/fft2d/fft.h create mode 100644 third_party/fft2d/fft2d.BUILD (limited to 'third_party/fft2d') diff --git a/third_party/fft2d/BUILD b/third_party/fft2d/BUILD new file mode 100644 index 0000000000..93ea06e81b --- /dev/null +++ b/third_party/fft2d/BUILD @@ -0,0 +1,30 @@ +# Headers for 2D Fast Fourier Transform package +# from http://momonga.t.u-tokyo.ac.jp/~ooura/fft.html +# This is a separate package because the original downloaded archive doesn't +# contain any header files. + +package( + default_visibility = ["//visibility:public"], +) + +# Unrestricted use; can only distribute original package. +# See fft/readme.txt +licenses(["notice"]) + +exports_files(["LICENSE"]) + +cc_library( + name = "fft2d_headers", + srcs = ["fft.h"], +) + +objc_library( + name = "fft2d_headersd_ios", + srcs = ["fft.h"], +) + +# Export the source code so that it could be compiled for Andoid native apps. +filegroup( + name = "fft2d_headers_srcs", + srcs = ["fft.h"], +) diff --git a/third_party/fft2d/LICENSE b/third_party/fft2d/LICENSE new file mode 100644 index 0000000000..2bd85506a8 --- /dev/null +++ b/third_party/fft2d/LICENSE @@ -0,0 +1,3 @@ +Copyright(C) 1997,2001 Takuya OOURA (email: ooura@kurims.kyoto-u.ac.jp). +You may use, copy, modify this code for any purpose and +without fee. You may distribute this ORIGINAL package. diff --git a/third_party/fft2d/fft.h b/third_party/fft2d/fft.h new file mode 100644 index 0000000000..252cc01fec --- /dev/null +++ b/third_party/fft2d/fft.h @@ -0,0 +1,36 @@ +/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +// Declarations for 1D FFT routines in third_party/fft2d/fft. + +#ifndef THIRD_PARTY_FFT2D_FFT_H__ +#define THIRD_PARTY_FFT2D_FFT_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +extern void cdft(int, int, double *, int *, double *); +extern void rdft(int, int, double *, int *, double *); +extern void ddct(int, int, double *, int *, double *); +extern void ddst(int, int, double *, int *, double *); +extern void dfct(int, double *, double *, int *, double *); +extern void dfst(int, double *, double *, int *, double *); + +#ifdef __cplusplus +} +#endif + +#endif // THIRD_PARTY_FFT2D_FFT_H__ diff --git a/third_party/fft2d/fft2d.BUILD b/third_party/fft2d/fft2d.BUILD new file mode 100644 index 0000000000..3dbd36aec0 --- /dev/null +++ b/third_party/fft2d/fft2d.BUILD @@ -0,0 +1,36 @@ +# 2D Fast Fourier Transform package +# from http://momonga.t.u-tokyo.ac.jp/~ooura/fft.html + +package( + default_visibility = ["//visibility:public"], +) + +# Unrestricted use; can only distribute original package. +licenses(["notice"]) + +exports_files(["fft/readme.txt"]) + +FFT2D_SRCS = [ + "fft/fftsg.c", +] + +# This is the main 2D FFT library. The 2D FFTs in this library call +# 1D FFTs. In addition, fast DCTs are provided for the special case +# of 8x8 and 16x16. This code in this library is referred to as +# "Version II" on http://momonga.t.u-tokyo.ac.jp/~ooura/fft.html. +cc_library( + name = "fft2d", + srcs = FFT2D_SRCS, + linkopts = ["-lm"], +) + +objc_library( + name = "fft2d_ios", + srcs = FFT2D_SRCS, +) + +# Export the source code so that it could be compiled for Andoid native apps. +filegroup( + name = "fft2d_srcs", + srcs = FFT2D_SRCS, +) -- cgit v1.2.3