久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='ozd9G'><style id='ozd9G'><dir id='ozd9G'><q id='ozd9G'></q></dir></style></legend>

      • <bdo id='ozd9G'></bdo><ul id='ozd9G'></ul>

        <tfoot id='ozd9G'></tfoot>

        <i id='ozd9G'><tr id='ozd9G'><dt id='ozd9G'><q id='ozd9G'><span id='ozd9G'><b id='ozd9G'><form id='ozd9G'><ins id='ozd9G'></ins><ul id='ozd9G'></ul><sub id='ozd9G'></sub></form><legend id='ozd9G'></legend><bdo id='ozd9G'><pre id='ozd9G'><center id='ozd9G'></center></pre></bdo></b><th id='ozd9G'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ozd9G'><tfoot id='ozd9G'></tfoot><dl id='ozd9G'><fieldset id='ozd9G'></fieldset></dl></div>

        <small id='ozd9G'></small><noframes id='ozd9G'>

      1. 在給定時間內將頻率從 f1 緩慢上升到 f2 的正弦波

        sine wave that slowly ramps up frequency from f1 to f2 for a given time(在給定時間內將頻率從 f1 緩慢上升到 f2 的正弦波)

            1. <tfoot id='tycmG'></tfoot>
              <i id='tycmG'><tr id='tycmG'><dt id='tycmG'><q id='tycmG'><span id='tycmG'><b id='tycmG'><form id='tycmG'><ins id='tycmG'></ins><ul id='tycmG'></ul><sub id='tycmG'></sub></form><legend id='tycmG'></legend><bdo id='tycmG'><pre id='tycmG'><center id='tycmG'></center></pre></bdo></b><th id='tycmG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='tycmG'><tfoot id='tycmG'></tfoot><dl id='tycmG'><fieldset id='tycmG'></fieldset></dl></div>

            2. <legend id='tycmG'><style id='tycmG'><dir id='tycmG'><q id='tycmG'></q></dir></style></legend>

                <small id='tycmG'></small><noframes id='tycmG'>

                • <bdo id='tycmG'></bdo><ul id='tycmG'></ul>
                    <tbody id='tycmG'></tbody>
                • 本文介紹了在給定時間內將頻率從 f1 緩慢上升到 f2 的正弦波的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在編寫一個 c 程序來生成一個正弦波,該正弦波在給定的時間間隔內將頻率從 f1 緩慢上升到 f2.

                  I'm writing a c program to generate a sinusoidal wave that slowly ramps up frequency from f1 to f2 for a giving time interval.

                  我已經編寫了這個 c 程序來將頻率從 0 提升到 10 Hz,但問題是頻率在 360 度完成后會發生變化.如果我嘗試在 0 到 360 度之間更改頻率,則過渡不平滑且突然.

                  I have written this c program to ramp the frequency from 0 to 10 Hz but the problem is that the frequency changes after completion of 360 degrees. If I try to change the frequency between 0 and 360 degree that the transition is not smooth and it is abrupt.

                  這是我用過的正弦方程 y = Amplitude*sin(freq*phase)

                  This is the equation the sin that I have used y = Amplitude*sin(freq*phase)

                  int main(int argc, char *argv[]) {
                  
                  double y, freq,phase;
                  int count; // for convenience of plotting in matlab so all the waves are spread on x axis.
                    for (freq = 0; freq < 10; freq+=1) {
                        for (phase = 0; phase < 360; phase++) { // phase is 360 degrees
                        y = 3 * sin((count*6.283185)+(freq*(phase*(3.14159/180))));   
                      printf("%f %f %f 
                  ", freq, phase, y);
                     }
                    count++;
                    }
                  return EXIT_SUCCESS;
                  }
                  

                  1. 如何在給定的時間段內平穩地改變頻率?
                  2. 我應該研究傅立葉變換嗎?

                  推薦答案

                  如果您希望角頻率 (w=2 p f) 隨時間線性變化,則 dw/dt = aw = w0 + (wn-w0)*t/tn (其中 t 從 0 到 tn,w 去從 w0wn).相位是它的積分,所以 phase = w0 t + (wn-w0)*t^2/(2tn) (正如 oli 所說):

                  if you want angular frequency (w=2 pi f) to vary linearly with time then dw/dt = a and w = w0 + (wn-w0)*t/tn (where t goes from 0 to tn, w goes from w0 to wn). phase is the integral of that, so phase = w0 t + (wn-w0)*t^2/(2tn) (as oli says):

                  void sweep(double f_start, double f_end, double interval, int n_steps) {
                      for (int i = 0; i < n_steps; ++i) {
                          double delta = i / (float)n_steps;
                          double t = interval * delta;
                          double phase = 2 * PI * t * (f_start + (f_end - f_start) * delta / 2);
                          while (phase > 2 * PI) phase -= 2 * PI; // optional
                          printf("%f %f %f", t, phase * 180 / PI, 3 * sin(phase));
                      }
                  }
                  

                  (其中間隔為 tn,增量為 t/tn).

                  (where interval is tn and delta is t/tn).

                  這是等效 python 代碼的輸出(5 秒內 1-10Hz):

                  here's the output for the equivalent python code (1-10Hz over 5 seconds):

                  from math import pi, sin
                  
                  def sweep(f_start, f_end, interval, n_steps):
                      for i in range(n_steps):
                          delta = i / float(n_steps)
                          t = interval * delta
                          phase = 2 * pi * t * (f_start + (f_end - f_start) * delta / 2)
                          print t, phase * 180 / pi, 3 * sin(phase)
                  
                  sweep(1, 10, 5, 1000)
                  

                  順便說一句,如果你正在聽這個(或看著它 - 任何涉及人類感知的東西),我懷疑你不想要線性增長,而是指數增長.但那是 一個不同的問題...

                  ps incidentally, if you're listening to this (or looking at it - anything that involves human perception) i suspect you don't want a linear increase, but an exponential one. but that's a different question...

                  這篇關于在給定時間內將頻率從 f1 緩慢上升到 f2 的正弦波的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                  When and how should I use exception handling?(我應該何時以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構造函數的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區別)

                  <i id='ifaDz'><tr id='ifaDz'><dt id='ifaDz'><q id='ifaDz'><span id='ifaDz'><b id='ifaDz'><form id='ifaDz'><ins id='ifaDz'></ins><ul id='ifaDz'></ul><sub id='ifaDz'></sub></form><legend id='ifaDz'></legend><bdo id='ifaDz'><pre id='ifaDz'><center id='ifaDz'></center></pre></bdo></b><th id='ifaDz'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ifaDz'><tfoot id='ifaDz'></tfoot><dl id='ifaDz'><fieldset id='ifaDz'></fieldset></dl></div>

                        <tbody id='ifaDz'></tbody>
                      <legend id='ifaDz'><style id='ifaDz'><dir id='ifaDz'><q id='ifaDz'></q></dir></style></legend>

                      <small id='ifaDz'></small><noframes id='ifaDz'>

                        <bdo id='ifaDz'></bdo><ul id='ifaDz'></ul>
                      • <tfoot id='ifaDz'></tfoot>

                          1. 主站蜘蛛池模板: 奇米影视在线 | 久久久久久国产精品久久 | 久久99久久98精品免观看软件 | 高清视频一区二区三区 | 一区二区三区视频免费看 | 天天想天天干 | 国产精品特级毛片一区二区三区 | 久久久蜜桃一区二区人 | 视频在线亚洲 | 亚洲精品99999 | 干干天天| 国产免费一区 | 日韩1区 | 久久精品一区二区三区四区 | 北条麻妃av一区二区三区 | 国产一区三区视频 | www312aⅴ欧美在线看 | 蜜桃视频在线观看www社区 | 亚洲成人免费av | 国产久视频 | 亚洲欧洲国产视频 | 爱草在线 | 午夜黄色 | 久久999| 欧美黄色网络 | 欧美日韩精品免费 | 国产乱码一区 | 在线观看中文字幕 | 精品一区二区三区在线观看国产 | 国产福利91精品一区二区三区 | 欧美 日韩 国产 成人 在线 91 | 中文字幕在线一区二区三区 | 国产精品一区二区三 | 国产原创视频 | 一级毛片视频免费观看 | 欧美男人亚洲天堂 | 亚洲第一免费播放区 | 一级片网址 | 亚洲精品久久久久久国产精华液 | 国产一区二 | 国产精品99久久久久久久久久久久 |