/* SPDX-License-Identifier: MIT */ #ifndef WCDMA_REFERENCE_H_HPP #define WCDMA_REFERENCE_H_HPP #include "wcdma.h" #include #include namespace sleela { namespace cdma { namespace wcdma { inline std::vector code(std::size_t sf, unsigned index) { std::vector c(sf); if (wcdma_make_code(c.data(), sf, index)) throw std::invalid_argument("invalid code"); return c; } inline std::vector spread(int symbol, std::size_t sf, unsigned index) { std::vector c(sf); if (wcdma_spread(symbol, sf, index, c.data())) throw std::invalid_argument("invalid spread parameters"); return c; } inline int recover(const std::vector& chips, unsigned index) { return wcdma_recover(chips.data(), chips.size(), index); } }}} #endif