如何用音频文件作为输入来暗含单边带抑制载波调制器?

问题描述

我得到了一个音频信号,我使用audioread将其导入到Octave中。我已经获得了fs,可以自然地绘制时域信号。进行FFT后,可以轻松地绘制频域。 我的问题是如何将这个信号作为输入并使用Octave中的SSB-SC调制对其进行调制?我相信我首先必须创建一个DSB,然后使用滤波器对边带进行滤波,但是我也不确定如何创建DSB(我可能能够创建的滤波器)。任何建议将不胜感激。

解决方法

有几种方法可以实现SSB-SC调制。例如,参见Wikipedia上的Single-sideband modulation - Practical implementations。有关更多详细信息,请参见以下有关SSB的不错的教程 http://www.eng.auburn.edu/~roppeth/courses/TIMS-manuals-r5/TIMS%20Experiment%20Manuals/Student_Text/Vol-A2/A2-03.pdf

Octave / Matlab具有以下构建模块,可用于实现SSB调制技术:

  • x来改变信号的频率,其中import React,{ useState } from "react"; import { Row,Col } from "../Grid"; import PropTypes from 'prop-types'; export default function Step1(props) { const [image_1,setImage_1] = useState({ preview_1: "",raw_1: "" }); const [image_2,setImage_2] = useState({ preview_2: "",raw_2: "" }); const [image_3,setImage_3] = useState({ preview_3: "",raw_3: "" }); const [image_4,setImage_4] = useState({ preview_4: "",raw_4: "" }); const handleLoadLocalFile = (event) => { event.preventDefault(); const file_1 = event.target.files[0]; const file_2 = event.target.files[0]; const file_3 = event.target.files[0]; const file_4 = event.target.files[0]; const localImageUrl_1 = window.URL.createObjectURL(file_1); const localImageUrl_2 = window.URL.createObjectURL(file_2); const localImageUrl_3 = window.URL.createObjectURL(file_3); const localImageUrl_4 = window.URL.createObjectURL(file_4); if(event.target.files.length){ setImage_1({ preview_1: localImageUrl_1,raw_1: file_1 }) setImage_2({ preview_2: localImageUrl_2,raw_2: file_2 }) setImage_3({ preview_3: localImageUrl_3,raw_3: file_3 }) setImage_4({ preview_4: localImageUrl_4,raw_4: file_4 }) props.onFileLoaded(localImageUrl_1); props.onFileLoaded(localImageUrl_2); props.onFileLoaded(localImageUrl_3); props.onFileLoaded(localImageUrl_4); } } const handleUpload = async event => { event.preventDefault(); const formData = new FormData(); formData.append("image_1",image_1.raw_1) formData.append("image_2",image_2.raw_2) formData.append("image_3",image_3.raw_3) formData.append("image_4",image_4.raw_4) } if(props.currentStep !== 1) { return null; } // const [image,setImage] = useState({ preview: "",raw: "" }); // const handleItemChange = e => { // if (e.target.files.length) { // setImage({ // preview: URL.createObjectURL(e.target.files[0]),// raw: e.target.files[0] // }); // } // }; // const handleItemUpload = async e => { // e.preventDefault(); // const formData = new FormData(); // formData.append("image",image.raw); // await fetch("/api/additem",{ // method: "POST",// headers: { // "Content-Type": "multipart/form-data" // },// body: formData // }); // }; //Markup for step 1 UI return( <Row> <Col size="md-6"> <div> <label htmlFor="upload-button" id="file_1"> {image_1.preview_1 ? ( <img src={image_1.preview_1} alt='dummy' width="100" height="100" /> ) : ( <img src={require("../../images/store.jpg")} style={{justifyContent: "center",alignItems: "center"}} alt="placeholder" width="100" height="100" /> /* // <> // <span className="fa-stack fa-2x mt-3 mb-2"> // <i className="fas fa-circle fa-stack-2x" /> // <i className="fas fa-store fa-stack-1x fa-inverse" /> // </span> // {/* <h5 className="text-center">Upload your photo</h5> // </> */ )} </label> <input type="file" id="upload-button" style={{ display: "none" }} value={props.localImageUrl_1} onChange={handleLoadLocalFile} /> <br/> <button onClick={handleUpload}>Upload</button> </div> <div> <label htmlFor="upload-button" id="file_2"> {image_2.preview_2 ? ( <img src={image_2.preview_2} alt="dummy" width="100" height="100" /> ) : ( <img src={require("../../images/store.jpg")} style={{justifyContent: "center",alignItems: "center"}} alt="placeholder" width="100" height="100" /> /* // <> // <span className="fa-stack fa-2x mt-3 mb-2"> // <i className="fas fa-circle fa-stack-2x" /> // <i className="fas fa-store fa-stack-1x fa-inverse" /> // </span> // {/* <h5 className="text-center">Upload your photo</h5> // </> */ )} </label> <input type="file" id="upload-button" style={{ display: "none" }} value={props.localImageUrl_2} onChange={handleLoadLocalFile} /> <br /> <button onClick={handleUpload}>Upload</button> </div> <br /> <div> <label htmlFor="upload-button" id="file_3"> {image_3.preview_3 ? ( <img src={image_3.preview_3} alt="dummy" width="100" height="100" /> ) : ( <img src={require("../../images/store.jpg")} style={{justifyContent: "center",alignItems: "center"}} alt="placeholder" width="100" height="100" /> /* // <> // <span className="fa-stack fa-2x mt-3 mb-2"> // <i className="fas fa-circle fa-stack-2x" /> // <i className="fas fa-store fa-stack-1x fa-inverse" /> // </span> // {/* <h5 className="text-center">Upload your photo</h5> // </> */ )} </label> <input type="file" id="upload-button" style={{ display: "none" }} value={props.localImageUrl_3} onChange={handleLoadLocalFile} /> <br /> <button onClick={handleUpload}>Upload</button> </div> <div> <label htmlFor="upload-button" id="file_4"> {image_4.preview_4 ? ( <img src={image_4.preview_4} alt="dummy" width="100" height="100" /> ) : ( <img src={require("../../images/store.jpg")} style={{justifyContent: "center",alignItems: "center"}} alt="placeholder" width="100" height="100" /> /* // <> // <span className="fa-stack fa-2x mt-3 mb-2"> // <i className="fas fa-circle fa-stack-2x" /> // <i className="fas fa-store fa-stack-1x fa-inverse" /> // </span> // {/* <h5 className="text-center">Upload your photo</h5> // </> )} */ )} </label> <input type="file" id="upload-button" style={{ display: "none" }} value={props.localImageUrl_4} onChange={handleLoadLocalFile} /> <br /> <button onClick={handleUpload}>Upload</button> </div> </Col> <Col size="md-6" fixed> <form> <label htmlFor="title">Title:</label> <input onChange={props.handleChange} value={props.title} name="title" type="text" className="form-control" placeholder="product title" id="title" /> <br/> <br/> <br/> <label htmlFor="price">Price:</label> <input onChange={props.handleChange} value={props.price} name="price" type="text" className="form-control" placeholder="product price" id="price" /> <br/> <br/> <br/> <label htmlFor="shelf">Shelf:</label>&nbsp;&nbsp; <select onChange={props.handleChange} value={props.shelf} name="shelf" id="shelf" > <option value="biscuits">Biscuits</option> <option value="breads">Breads</option> <option value="cakes">Cakes</option> <option value="pastries">Pastries</option> <option value="pizzas">Pizzas</option> <option value="signature">Signature</option> </select> </form> </Col> </Row> ) } Step1.propTypes = { onFileLoaded: PropTypes.func.isRequired } // export default Step1; 是时域(modulation / frequency shifting property)中的采样数组。

  • filter以应用FIR或IIR滤波器。要设计滤波器,信号包中有两个选项,firlsfir1

  • hilbert用于实值信号的希尔伯特变换(解析扩展)。